Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 40... Línea 40...
40
 
40
 
41
    /**
41
    /**
42
     * Tests that bootstrapping has occurred correctly
42
     * Tests that bootstrapping has occurred correctly
43
     * @return void
43
     * @return void
44
     */
44
     */
45
    public function test_bootstrap() {
45
    public function test_bootstrap(): void {
Línea 46... Línea 46...
46
        global $CFG;
46
        global $CFG;
47
 
47
 
48
        // The httpswwwroot has been deprecated, we keep it as an alias for backwards compatibility with plugins only.
48
        // The httpswwwroot has been deprecated, we keep it as an alias for backwards compatibility with plugins only.
Línea 53... Línea 53...
53
 
53
 
54
    /**
54
    /**
55
     * This is just a verification if I understand the PHPUnit assert docs right --skodak
55
     * This is just a verification if I understand the PHPUnit assert docs right --skodak
56
     * @return void
56
     * @return void
57
     */
57
     */
58
    public function test_assert_behaviour() {
58
    public function test_assert_behaviour(): void {
59
        // Arrays.
59
        // Arrays.
60
        $a = array('a', 'b', 'c');
60
        $a = array('a', 'b', 'c');
61
        $b = array('a', 'c', 'b');
61
        $b = array('a', 'c', 'b');
62
        $c = array('a', 'b', 'c');
62
        $c = array('a', 'b', 'c');
Línea 118... Línea 118...
118
 
118
 
119
    /**
119
    /**
120
     * Make sure there are no sloppy Windows line endings
120
     * Make sure there are no sloppy Windows line endings
121
     * that would break our tests.
121
     * that would break our tests.
122
     */
122
     */
123
    public function test_lineendings() {
123
    public function test_lineendings(): void {
124
        $string = <<<STRING
124
        $string = <<<STRING
125
a
125
a
126
b
126
b
127
STRING;
127
STRING;
Línea 130... Línea 130...
130
    }
130
    }
Línea 131... Línea 131...
131
 
131
 
132
    /**
132
    /**
133
     * Make sure asserts in setUp() do not create problems.
133
     * Make sure asserts in setUp() do not create problems.
134
     */
134
     */
135
    public function test_setup_assert() {
135
    public function test_setup_assert(): void {
136
        $this->assertTrue($this->testassertexecuted);
136
        $this->assertTrue($this->testassertexecuted);
137
        $this->testassertexecuted = false;
137
        $this->testassertexecuted = false;
Línea 138... Línea 138...
138
    }
138
    }
139
 
139
 
140
    /**
140
    /**
141
     * Test assert Tag
141
     * Test assert Tag
142
     */
142
     */
143
    public function test_assert_tag() {
143
    public function test_assert_tag(): void {
144
        // This should succeed.
144
        // This should succeed.
145
        self::assertTag(['id' => 'testid'], "<div><span id='testid'></span></div>");
145
        self::assertTag(['id' => 'testid'], "<div><span id='testid'></span></div>");
146
        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);
146
        $this->expectException(\PHPUnit\Framework\ExpectationFailedException::class);