Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 167... Línea 167...
167
    }
167
    }
Línea 168... Línea 168...
168
 
168
 
169
    /**
169
    /**
170
     * Test for provider::get_metadata().
170
     * Test for provider::get_metadata().
171
     */
171
     */
172
    public function test_get_metadata() {
172
    public function test_get_metadata(): void {
173
        $collection = new collection('block_comments');
173
        $collection = new collection('block_comments');
174
        $newcollection = provider::get_metadata($collection);
174
        $newcollection = provider::get_metadata($collection);
175
        $itemcollection = $newcollection->get_collection();
175
        $itemcollection = $newcollection->get_collection();
Línea 183... Línea 183...
183
    }
183
    }
Línea 184... Línea 184...
184
 
184
 
185
    /**
185
    /**
186
     * Test for provider::get_contexts_for_userid() when user had not posted any comments..
186
     * Test for provider::get_contexts_for_userid() when user had not posted any comments..
187
     */
187
     */
188
    public function test_get_contexts_for_userid_no_comment() {
188
    public function test_get_contexts_for_userid_no_comment(): void {
189
        $this->setUser($this->student1);
189
        $this->setUser($this->student1);
190
        $coursecontext1 = \context_course::instance($this->course1->id);
190
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 191... Línea 191...
191
        $this->add_comment('New comment', $coursecontext1);
191
        $this->add_comment('New comment', $coursecontext1);
Línea 196... Línea 196...
196
    }
196
    }
Línea 197... Línea 197...
197
 
197
 
198
    /**
198
    /**
199
     * Test for provider::get_contexts_for_userid().
199
     * Test for provider::get_contexts_for_userid().
200
     */
200
     */
201
    public function test_get_contexts_for_userid() {
201
    public function test_get_contexts_for_userid(): void {
202
        $coursecontext1 = \context_course::instance($this->course1->id);
202
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 203... Línea 203...
203
        $coursecontext2 = \context_course::instance($this->course2->id);
203
        $coursecontext2 = \context_course::instance($this->course2->id);
204
 
204
 
Línea 215... Línea 215...
215
    }
215
    }
Línea 216... Línea 216...
216
 
216
 
217
    /**
217
    /**
218
     * Test for provider::export_user_data() when the user has not posted any comments.
218
     * Test for provider::export_user_data() when the user has not posted any comments.
219
     */
219
     */
220
    public function test_export_for_context_no_comment() {
220
    public function test_export_for_context_no_comment(): void {
221
        $coursecontext1 = \context_course::instance($this->course1->id);
221
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 222... Línea 222...
222
        $coursecontext2 = \context_course::instance($this->course2->id);
222
        $coursecontext2 = \context_course::instance($this->course2->id);
223
 
223
 
Línea 234... Línea 234...
234
    }
234
    }
Línea 235... Línea 235...
235
 
235
 
236
    /**
236
    /**
237
     * Test for provider::export_user_data().
237
     * Test for provider::export_user_data().
238
     */
238
     */
239
    public function test_export_for_context() {
239
    public function test_export_for_context(): void {
240
        $coursecontext1 = \context_course::instance($this->course1->id);
240
        $coursecontext1 = \context_course::instance($this->course1->id);
Línea 241... Línea 241...
241
        $coursecontext2 = \context_course::instance($this->course2->id);
241
        $coursecontext2 = \context_course::instance($this->course2->id);
242
 
242
 
Línea 252... Línea 252...
252
    }
252
    }
Línea 253... Línea 253...
253
 
253
 
254
    /**
254
    /**
255
     * Test for provider::delete_data_for_all_users_in_context().
255
     * Test for provider::delete_data_for_all_users_in_context().
256
     */
256
     */
257
    public function test_delete_data_for_all_users_in_context() {
257
    public function test_delete_data_for_all_users_in_context(): void {
Línea 258... Línea 258...
258
        global $DB;
258
        global $DB;
259
 
259
 
Línea 296... Línea 296...
296
    }
296
    }
Línea 297... Línea 297...
297
 
297
 
298
    /**
298
    /**
299
     * Test for provider::delete_data_for_all_users_in_context() when there are also comments from other plugins.
299
     * Test for provider::delete_data_for_all_users_in_context() when there are also comments from other plugins.
300
     */
300
     */
301
    public function test_delete_data_for_all_users_in_context_with_comments_from_other_plugins() {
301
    public function test_delete_data_for_all_users_in_context_with_comments_from_other_plugins(): void {
Línea 302... Línea 302...
302
        global $DB;
302
        global $DB;
303
 
303
 
304
        $assigngenerator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
304
        $assigngenerator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
Línea 358... Línea 358...
358
    }
358
    }
Línea 359... Línea 359...
359
 
359
 
360
    /**
360
    /**
361
     * Test for provider::delete_data_for_user().
361
     * Test for provider::delete_data_for_user().
362
     */
362
     */
363
    public function test_delete_data_for_user() {
363
    public function test_delete_data_for_user(): void {
Línea 364... Línea 364...
364
        global $DB;
364
        global $DB;
365
 
365
 
Línea 412... Línea 412...
412
    }
412
    }
Línea 413... Línea 413...
413
 
413
 
414
    /**
414
    /**
415
     * Test for provider::delete_data_for_user() when there are also comments from other plugins.
415
     * Test for provider::delete_data_for_user() when there are also comments from other plugins.
416
     */
416
     */
417
    public function test_delete_data_for_user_with_comments_from_other_plugins() {
417
    public function test_delete_data_for_user_with_comments_from_other_plugins(): void {
Línea 418... Línea 418...
418
        global $DB;
418
        global $DB;
419
 
419
 
420
        $assigngenerator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
420
        $assigngenerator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
Línea 471... Línea 471...
471
 
471
 
472
    /**
472
    /**
473
     * Test that only users within a course context are fetched.
473
     * Test that only users within a course context are fetched.
474
     * @group qtesttt
474
     * @group qtesttt
475
     */
475
     */
476
    public function test_get_users_in_context() {
476
    public function test_get_users_in_context(): void {
Línea 477... Línea 477...
477
        $component = 'block_comments';
477
        $component = 'block_comments';
478
 
478
 
Línea 508... Línea 508...
508
    }
508
    }
Línea 509... Línea 509...
509
 
509
 
510
    /**
510
    /**
511
     * Test that data for users in approved userlist is deleted.
511
     * Test that data for users in approved userlist is deleted.
512
     */
512
     */
513
    public function test_delete_data_for_users() {
513
    public function test_delete_data_for_users(): void {
Línea 514... Línea 514...
514
        $component = 'block_comments';
514
        $component = 'block_comments';
515
 
515
 
Línea 549... Línea 549...
549
    }
549
    }
Línea 550... Línea 550...
550
 
550
 
551
    /**
551
    /**
552
     * Test for provider::delete_data_for_user() when there are also comments from other plugins.
552
     * Test for provider::delete_data_for_user() when there are also comments from other plugins.
553
     */
553
     */
554
    public function test_delete_data_for_users_with_comments_from_other_plugins() {
554
    public function test_delete_data_for_users_with_comments_from_other_plugins(): void {
Línea 555... Línea 555...
555
        $component = 'block_comments';
555
        $component = 'block_comments';
556
 
556
 
557
        $assigngenerator = $this->getDataGenerator()->get_plugin_generator('mod_assign');
557
        $assigngenerator = $this->getDataGenerator()->get_plugin_generator('mod_assign');