Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 37... Línea 37...
37
 
37
 
38
    public function setUp(): void {
38
    public function setUp(): void {
39
        $this->resetAfterTest();
39
        $this->resetAfterTest();
Línea 40... Línea 40...
40
    }
40
    }
41
 
41
 
42
    public function test_function_called() {
42
    public function test_function_called(): void {
43
        // The Web service API doesn't allow the testing of the events directly by
43
        // The Web service API doesn't allow the testing of the events directly by
Línea 44... Línea 44...
44
        // calling some functions which trigger the events, so what we are going here
44
        // calling some functions which trigger the events, so what we are going here
Línea 61... Línea 61...
61
        $this->assertEquals(\context_system::instance(), $event->get_context());
61
        $this->assertEquals(\context_system::instance(), $event->get_context());
62
        $this->assertEquals('A function', $event->other['function']);
62
        $this->assertEquals('A function', $event->other['function']);
63
        $this->assertEventContextNotUsed($event);
63
        $this->assertEventContextNotUsed($event);
64
    }
64
    }
Línea 65... Línea 65...
65
 
65
 
66
    public function test_login_failed() {
66
    public function test_login_failed(): void {
67
        // The Web service API doesn't allow the testing of the events directly by
67
        // The Web service API doesn't allow the testing of the events directly by
68
        // calling some functions which trigger the events, so what we are going here
68
        // calling some functions which trigger the events, so what we are going here
Línea 69... Línea 69...
69
        // is just checking that the event returns the expected information.
69
        // is just checking that the event returns the expected information.
Línea 97... Línea 97...
97
        } catch (\coding_exception $e) {
97
        } catch (\coding_exception $e) {
98
        }
98
        }
99
        $this->assertEventContextNotUsed($event);
99
        $this->assertEventContextNotUsed($event);
100
    }
100
    }
Línea 101... Línea 101...
101
 
101
 
102
    public function test_service_created() {
102
    public function test_service_created(): void {
Línea 103... Línea 103...
103
        global $CFG, $DB;
103
        global $CFG, $DB;
104
 
104
 
105
        // The Web service API doesn't allow the testing of the events directly by
105
        // The Web service API doesn't allow the testing of the events directly by
Línea 139... Línea 139...
139
        $this->assertEquals(\context_system::instance(), $event->get_context());
139
        $this->assertEquals(\context_system::instance(), $event->get_context());
140
        $this->assertEquals($service->id, $event->objectid);
140
        $this->assertEquals($service->id, $event->objectid);
141
        $this->assertEventContextNotUsed($event);
141
        $this->assertEventContextNotUsed($event);
142
    }
142
    }
Línea 143... Línea 143...
143
 
143
 
144
    public function test_service_updated() {
144
    public function test_service_updated(): void {
Línea 145... Línea 145...
145
        global $CFG, $DB;
145
        global $CFG, $DB;
146
 
146
 
147
        // The Web service API doesn't allow the testing of the events directly by
147
        // The Web service API doesn't allow the testing of the events directly by
Línea 181... Línea 181...
181
        $this->assertEquals(\context_system::instance(), $event->get_context());
181
        $this->assertEquals(\context_system::instance(), $event->get_context());
182
        $this->assertEquals($service->id, $event->objectid);
182
        $this->assertEquals($service->id, $event->objectid);
183
        $this->assertEventContextNotUsed($event);
183
        $this->assertEventContextNotUsed($event);
184
    }
184
    }
Línea 185... Línea 185...
185
 
185
 
186
    public function test_service_deleted() {
186
    public function test_service_deleted(): void {
Línea 187... Línea 187...
187
        global $CFG, $DB;
187
        global $CFG, $DB;
188
 
188
 
189
        // The Web service API doesn't allow the testing of the events directly by
189
        // The Web service API doesn't allow the testing of the events directly by
Línea 223... Línea 223...
223
        $this->assertEquals(\context_system::instance(), $event->get_context());
223
        $this->assertEquals(\context_system::instance(), $event->get_context());
224
        $this->assertEquals($service->id, $event->objectid);
224
        $this->assertEquals($service->id, $event->objectid);
225
        $this->assertEventContextNotUsed($event);
225
        $this->assertEventContextNotUsed($event);
226
    }
226
    }
Línea 227... Línea 227...
227
 
227
 
228
    public function test_service_user_added() {
228
    public function test_service_user_added(): void {
Línea 229... Línea 229...
229
        global $CFG;
229
        global $CFG;
230
 
230
 
231
        // The Web service API doesn't allow the testing of the events directly by
231
        // The Web service API doesn't allow the testing of the events directly by
Línea 249... Línea 249...
249
        $this->assertEquals(1, $event->objectid);
249
        $this->assertEquals(1, $event->objectid);
250
        $this->assertEquals(2, $event->relateduserid);
250
        $this->assertEquals(2, $event->relateduserid);
251
        $this->assertEventContextNotUsed($event);
251
        $this->assertEventContextNotUsed($event);
252
    }
252
    }
Línea 253... Línea 253...
253
 
253
 
254
    public function test_service_user_removed() {
254
    public function test_service_user_removed(): void {
Línea 255... Línea 255...
255
        global $CFG;
255
        global $CFG;
256
 
256
 
257
        // The Web service API doesn't allow the testing of the events directly by
257
        // The Web service API doesn't allow the testing of the events directly by
Línea 275... Línea 275...
275
        $this->assertEquals(1, $event->objectid);
275
        $this->assertEquals(1, $event->objectid);
276
        $this->assertEquals(2, $event->relateduserid);
276
        $this->assertEquals(2, $event->relateduserid);
277
        $this->assertEventContextNotUsed($event);
277
        $this->assertEventContextNotUsed($event);
278
    }
278
    }
Línea 279... Línea 279...
279
 
279
 
280
    public function test_token_created() {
280
    public function test_token_created(): void {
281
        // The Web service API doesn't allow the testing of the events directly by
281
        // The Web service API doesn't allow the testing of the events directly by
282
        // calling some functions which trigger the events, so what we are going here
282
        // calling some functions which trigger the events, so what we are going here
Línea 283... Línea 283...
283
        // is just checking that the event returns the expected information.
283
        // is just checking that the event returns the expected information.
Línea 302... Línea 302...
302
        $this->assertEquals(1, $event->objectid);
302
        $this->assertEquals(1, $event->objectid);
303
        $this->assertEquals(2, $event->relateduserid);
303
        $this->assertEquals(2, $event->relateduserid);
304
        $this->assertEventContextNotUsed($event);
304
        $this->assertEventContextNotUsed($event);
305
    }
305
    }
Línea 306... Línea 306...
306
 
306
 
307
    public function test_token_sent() {
307
    public function test_token_sent(): void {
308
        $user = $this->getDataGenerator()->create_user();
308
        $user = $this->getDataGenerator()->create_user();
Línea 309... Línea 309...
309
        $this->setUser($user);
309
        $this->setUser($user);
310
 
310