Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 56... Línea 56...
56
        // Chat module is disabled by default, enable it for testing.
56
        // Chat module is disabled by default, enable it for testing.
57
        $manager = \core_plugin_manager::resolve_plugininfo_class('mod');
57
        $manager = \core_plugin_manager::resolve_plugininfo_class('mod');
58
        $manager::enable_plugin('chat', 1);
58
        $manager::enable_plugin('chat', 1);
59
    }
59
    }
Línea 60... Línea 60...
60
 
60
 
61
    public function test_get_contexts_for_userid() {
61
    public function test_get_contexts_for_userid(): void {
62
        global $DB;
62
        global $DB;
63
        $dg = $this->getDataGenerator();
63
        $dg = $this->getDataGenerator();
64
        $c1 = $dg->create_course();
64
        $c1 = $dg->create_course();
Línea 103... Línea 103...
103
    }
103
    }
Línea 104... Línea 104...
104
 
104
 
105
    /**
105
    /**
106
     * Test that only users with relevant contexts are fetched.
106
     * Test that only users with relevant contexts are fetched.
107
     */
107
     */
108
    public function test_get_users_in_context() {
108
    public function test_get_users_in_context(): void {
109
        $component = 'mod_chat';
109
        $component = 'mod_chat';
110
        $dg = $this->getDataGenerator();
110
        $dg = $this->getDataGenerator();
111
        $c1 = $dg->create_course();
111
        $c1 = $dg->create_course();
Línea 165... Línea 165...
165
        $expected = [$u1->id];
165
        $expected = [$u1->id];
166
        $actual = $userlist1a->get_userids();
166
        $actual = $userlist1a->get_userids();
167
        $this->assertEquals($expected, $actual);
167
        $this->assertEquals($expected, $actual);
168
    }
168
    }
Línea 169... Línea 169...
169
 
169
 
170
    public function test_delete_data_for_all_users_in_context() {
170
    public function test_delete_data_for_all_users_in_context(): void {
171
        global $DB;
171
        global $DB;
172
        $dg = $this->getDataGenerator();
172
        $dg = $this->getDataGenerator();
Línea 173... Línea 173...
173
        $c1 = $dg->create_course();
173
        $c1 = $dg->create_course();
Línea 213... Línea 213...
213
        $this->assert_has_no_data_in_chat($u2, $chat1a);
213
        $this->assert_has_no_data_in_chat($u2, $chat1a);
214
        $this->assert_has_data_in_chat($u1, $chat1b);
214
        $this->assert_has_data_in_chat($u1, $chat1b);
215
        $this->assert_has_data_in_chat($u2, $chat1b);
215
        $this->assert_has_data_in_chat($u2, $chat1b);
216
    }
216
    }
Línea 217... Línea 217...
217
 
217
 
218
    public function test_delete_data_for_user() {
218
    public function test_delete_data_for_user(): void {
219
        global $DB;
219
        global $DB;
220
        $dg = $this->getDataGenerator();
220
        $dg = $this->getDataGenerator();
Línea 221... Línea 221...
221
        $c1 = $dg->create_course();
221
        $c1 = $dg->create_course();
Línea 262... Línea 262...
262
    }
262
    }
Línea 263... Línea 263...
263
 
263
 
264
    /**
264
    /**
265
     * Test that data for users in approved userlist is deleted.
265
     * Test that data for users in approved userlist is deleted.
266
     */
266
     */
267
    public function test_delete_data_for_users() {
267
    public function test_delete_data_for_users(): void {
268
        global $DB;
268
        global $DB;
269
        $component = 'mod_chat';
269
        $component = 'mod_chat';
270
        $dg = $this->getDataGenerator();
270
        $dg = $this->getDataGenerator();
Línea 315... Línea 315...
315
        $this->assert_has_data_in_chat($u1, $chat2);
315
        $this->assert_has_data_in_chat($u1, $chat2);
316
        $this->assert_has_data_in_chat($u2, $chat2);
316
        $this->assert_has_data_in_chat($u2, $chat2);
317
        $this->assert_has_data_in_chat($u3, $chat2);
317
        $this->assert_has_data_in_chat($u3, $chat2);
318
    }
318
    }
Línea 319... Línea 319...
319
 
319
 
320
    public function test_export_data_for_user() {
320
    public function test_export_data_for_user(): void {
321
        global $DB;
321
        global $DB;
322
        $dg = $this->getDataGenerator();
322
        $dg = $this->getDataGenerator();
Línea 323... Línea 323...
323
        $c1 = $dg->create_course();
323
        $c1 = $dg->create_course();