Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 242... Línea 242...
242
    }
242
    }
Línea 243... Línea 243...
243
 
243
 
244
    /**
244
    /**
245
     * Test getting the contexts for a user.
245
     * Test getting the contexts for a user.
246
     */
246
     */
Línea 247... Línea 247...
247
    public function test_get_contexts_for_userid() {
247
    public function test_get_contexts_for_userid(): void {
248
 
248
 
249
        // Get contexts for the first user.
249
        // Get contexts for the first user.
250
        $contextids = provider::get_contexts_for_userid($this->users[1]->id)->get_contextids();
250
        $contextids = provider::get_contexts_for_userid($this->users[1]->id)->get_contextids();
Línea 271... Línea 271...
271
    }
271
    }
Línea 272... Línea 272...
272
 
272
 
273
    /**
273
    /**
274
     * Test getting the users within a context.
274
     * Test getting the users within a context.
275
     */
275
     */
276
    public function test_get_users_in_context() {
276
    public function test_get_users_in_context(): void {
277
        global $DB;
277
        global $DB;
Línea 278... Línea 278...
278
        $component = 'mod_wiki';
278
        $component = 'mod_wiki';
279
 
279
 
Línea 325... Línea 325...
325
    }
325
    }
Línea 326... Línea 326...
326
 
326
 
327
    /**
327
    /**
328
     * Export data for user 1
328
     * Export data for user 1
329
     */
329
     */
Línea 330... Línea 330...
330
    public function test_export_user_data1() {
330
    public function test_export_user_data1(): void {
331
 
331
 
332
        // Export all contexts for the first user.
332
        // Export all contexts for the first user.
333
        $contextids = array_values(array_map(function($c) {
333
        $contextids = array_values(array_map(function($c) {
Línea 381... Línea 381...
381
    }
381
    }
Línea 382... Línea 382...
382
 
382
 
383
    /**
383
    /**
384
     * Test export data for user 2
384
     * Test export data for user 2
385
     */
385
     */
Línea 386... Línea 386...
386
    public function test_export_user_data2() {
386
    public function test_export_user_data2(): void {
387
 
387
 
388
        // Export all contexts for the second user.
388
        // Export all contexts for the second user.
389
        $contextids = array_values(array_map(function($c) {
389
        $contextids = array_values(array_map(function($c) {
Línea 432... Línea 432...
432
    }
432
    }
Línea 433... Línea 433...
433
 
433
 
434
    /**
434
    /**
435
     * Test export data for user 3 (locks, empty individual wiki)
435
     * Test export data for user 3 (locks, empty individual wiki)
436
     */
436
     */
Línea 437... Línea 437...
437
    public function test_export_user_data3() {
437
    public function test_export_user_data3(): void {
438
 
438
 
439
        // Export all contexts for the third user.
439
        // Export all contexts for the third user.
440
        $contextids = array_values(array_map(function($c) {
440
        $contextids = array_values(array_map(function($c) {
Línea 513... Línea 513...
513
    }
513
    }
Línea 514... Línea 514...
514
 
514
 
515
    /**
515
    /**
516
     * Test export data when there are comments.
516
     * Test export data when there are comments.
517
     */
517
     */
518
    public function test_export_user_data_with_comments() {
518
    public function test_export_user_data_with_comments(): void {
519
        global $DB;
519
        global $DB;
520
        // Comment on each page in the first wiki as the first user.
520
        // Comment on each page in the first wiki as the first user.
521
        $this->setUser($this->users[1]);
521
        $this->setUser($this->users[1]);
522
        $this->add_comment($this->pages[1][1], 'Hello111');
522
        $this->add_comment($this->pages[1][1], 'Hello111');
Línea 558... Línea 558...
558
    }
558
    }
Línea 559... Línea 559...
559
 
559
 
560
    /**
560
    /**
561
     * Test for delete_data_for_all_users_in_context().
561
     * Test for delete_data_for_all_users_in_context().
562
     */
562
     */
563
    public function test_delete_data_for_all_users_in_context() {
563
    public function test_delete_data_for_all_users_in_context(): void {
Línea 564... Línea 564...
564
        provider::delete_data_for_all_users_in_context($this->contexts[1]);
564
        provider::delete_data_for_all_users_in_context($this->contexts[1]);
565
 
565
 
566
        $appctx = new approved_contextlist($this->users[1], 'mod_wiki',
566
        $appctx = new approved_contextlist($this->users[1], 'mod_wiki',
Línea 581... Línea 581...
581
    }
581
    }
Línea 582... Línea 582...
582
 
582
 
583
    /**
583
    /**
584
     * Test for delete_data_for_user().
584
     * Test for delete_data_for_user().
585
     */
585
     */
586
    public function test_delete_data_for_user() {
586
    public function test_delete_data_for_user(): void {
587
        $appctx = new approved_contextlist($this->users[1], 'mod_wiki',
587
        $appctx = new approved_contextlist($this->users[1], 'mod_wiki',
588
            [$this->contexts[1]->id, $this->contexts[1]->id]);
588
            [$this->contexts[1]->id, $this->contexts[1]->id]);
Línea 589... Línea 589...
589
        provider::delete_data_for_user($appctx);
589
        provider::delete_data_for_user($appctx);
Línea 594... Línea 594...
594
    }
594
    }
Línea 595... Línea 595...
595
 
595
 
596
    /**
596
    /**
597
     * Test for delete_data_for_users().
597
     * Test for delete_data_for_users().
598
     */
598
     */
599
    public function test_delete_data_for_users() {
599
    public function test_delete_data_for_users(): void {
Línea 600... Línea 600...
600
        $component = 'mod_wiki';
600
        $component = 'mod_wiki';
601
 
601
 
602
        // Ensure data exists within context 2 - individual wikis.
602
        // Ensure data exists within context 2 - individual wikis.