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
        // Survey module is disabled by default, enable it for testing.
56
        // Survey 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('survey', 1);
58
        $manager::enable_plugin('survey', 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 {
Línea 62... Línea 62...
62
        $dg = $this->getDataGenerator();
62
        $dg = $this->getDataGenerator();
63
 
63
 
64
        $c1 = $dg->create_course();
64
        $c1 = $dg->create_course();
Línea 92... Línea 92...
92
    }
92
    }
Línea 93... Línea 93...
93
 
93
 
94
    /**
94
    /**
95
     * Test for provider::test_get_users_in_context().
95
     * Test for provider::test_get_users_in_context().
96
     */
96
     */
97
    public function test_get_users_in_context() {
97
    public function test_get_users_in_context(): void {
98
        $dg = $this->getDataGenerator();
98
        $dg = $this->getDataGenerator();
Línea 99... Línea 99...
99
        $component = 'mod_survey';
99
        $component = 'mod_survey';
100
 
100
 
Línea 142... Línea 142...
142
        $actual = $userlist->get_userids();
142
        $actual = $userlist->get_userids();
143
        sort($actual);
143
        sort($actual);
144
        $this->assertEquals($bothusers, $actual);
144
        $this->assertEquals($bothusers, $actual);
145
    }
145
    }
Línea 146... Línea 146...
146
 
146
 
147
    public function test_delete_data_for_all_users_in_context() {
147
    public function test_delete_data_for_all_users_in_context(): void {
148
        global $DB;
148
        global $DB;
Línea 149... Línea 149...
149
        $dg = $this->getDataGenerator();
149
        $dg = $this->getDataGenerator();
150
 
150
 
Línea 203... Línea 203...
203
        $this->assertTrue($DB->record_exists('survey_analysis', ['userid' => $u1->id, 'survey' => $cm1b->id]));
203
        $this->assertTrue($DB->record_exists('survey_analysis', ['userid' => $u1->id, 'survey' => $cm1b->id]));
204
        $this->assertFalse($DB->record_exists('survey_analysis', ['userid' => $u2->id, 'survey' => $cm1a->id]));
204
        $this->assertFalse($DB->record_exists('survey_analysis', ['userid' => $u2->id, 'survey' => $cm1a->id]));
205
        $this->assertFalse($DB->record_exists('survey_analysis', ['userid' => $u2->id, 'survey' => $cm1c->id]));
205
        $this->assertFalse($DB->record_exists('survey_analysis', ['userid' => $u2->id, 'survey' => $cm1c->id]));
206
    }
206
    }
Línea 207... Línea 207...
207
 
207
 
208
    public function test_delete_data_for_user() {
208
    public function test_delete_data_for_user(): void {
209
        global $DB;
209
        global $DB;
Línea 210... Línea 210...
210
        $dg = $this->getDataGenerator();
210
        $dg = $this->getDataGenerator();
211
 
211
 
Línea 250... Línea 250...
250
    }
250
    }
Línea 251... Línea 251...
251
 
251
 
252
    /**
252
    /**
253
     * Test for provider::delete_data_for_users().
253
     * Test for provider::delete_data_for_users().
254
     */
254
     */
255
    public function test_delete_data_for_users() {
255
    public function test_delete_data_for_users(): void {
256
        global $DB;
256
        global $DB;
257
        $dg = $this->getDataGenerator();
257
        $dg = $this->getDataGenerator();
Línea 258... Línea 258...
258
        $component = 'mod_survey';
258
        $component = 'mod_survey';
Línea 305... Línea 305...
305
 
305
 
306
        $this->assertTrue($DB->record_exists('survey_answers', ['userid' => $u1->id, 'survey' => $cm1c->id]));
306
        $this->assertTrue($DB->record_exists('survey_answers', ['userid' => $u1->id, 'survey' => $cm1c->id]));
307
        $this->assertTrue($DB->record_exists('survey_analysis', ['userid' => $u2->id, 'survey' => $cm1c->id]));
307
        $this->assertTrue($DB->record_exists('survey_analysis', ['userid' => $u2->id, 'survey' => $cm1c->id]));
Línea 308... Línea 308...
308
    }
308
    }
309
 
309
 
310
    public function test_export_data_for_user() {
310
    public function test_export_data_for_user(): void {
Línea 311... Línea 311...
311
        global $DB;
311
        global $DB;