Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 49... Línea 49...
49
        unset($enabled['flatfile']);
49
        unset($enabled['flatfile']);
50
        $enabled = array_keys($enabled);
50
        $enabled = array_keys($enabled);
51
        set_config('enrol_plugins_enabled', implode(',', $enabled));
51
        set_config('enrol_plugins_enabled', implode(',', $enabled));
52
    }
52
    }
Línea 53... Línea 53...
53
 
53
 
54
    public function test_basics() {
54
    public function test_basics(): void {
55
        $this->assertFalse(enrol_is_enabled('flatfile'));
55
        $this->assertFalse(enrol_is_enabled('flatfile'));
56
        $plugin = enrol_get_plugin('flatfile');
56
        $plugin = enrol_get_plugin('flatfile');
57
        $this->assertInstanceOf('enrol_flatfile_plugin', $plugin);
57
        $this->assertInstanceOf('enrol_flatfile_plugin', $plugin);
58
        $this->assertEquals(ENROL_EXT_REMOVED_SUSPENDNOROLES, get_config('enrol_flatfile', 'expiredaction'));
58
        $this->assertEquals(ENROL_EXT_REMOVED_SUSPENDNOROLES, get_config('enrol_flatfile', 'expiredaction'));
Línea 59... Línea 59...
59
    }
59
    }
60
 
60
 
Línea 61... Línea 61...
61
    public function test_sync_nothing() {
61
    public function test_sync_nothing(): void {
62
        $this->resetAfterTest();
62
        $this->resetAfterTest();
Línea 68... Línea 68...
68
        $flatfileplugin->sync(new \null_progress_trace());
68
        $flatfileplugin->sync(new \null_progress_trace());
69
        $this->enable_plugin();
69
        $this->enable_plugin();
70
        $flatfileplugin->sync(new \null_progress_trace());
70
        $flatfileplugin->sync(new \null_progress_trace());
71
    }
71
    }
Línea 72... Línea 72...
72
 
72
 
73
    public function test_sync() {
73
    public function test_sync(): void {
74
        global $CFG, $DB;
74
        global $CFG, $DB;
Línea 75... Línea 75...
75
        $this->resetAfterTest();
75
        $this->resetAfterTest();
76
 
76
 
Línea 275... Línea 275...
275
        $this->assertFalse($DB->record_exists('role_assignments', array('contextid'=>$context3->id, 'userid'=>$user5->id, 'roleid'=>$teacherrole->id)));
275
        $this->assertFalse($DB->record_exists('role_assignments', array('contextid'=>$context3->id, 'userid'=>$user5->id, 'roleid'=>$teacherrole->id)));
276
        $this->assertFalse($DB->record_exists('user_enrolments', array('userid'=>$user5->id, 'enrolid'=>$maninstance3->id)));
276
        $this->assertFalse($DB->record_exists('user_enrolments', array('userid'=>$user5->id, 'enrolid'=>$maninstance3->id)));
277
        $this->assertTrue($DB->record_exists('user_enrolments', array('userid'=>$user1->id, 'enrolid'=>$maninstance1->id)));
277
        $this->assertTrue($DB->record_exists('user_enrolments', array('userid'=>$user1->id, 'enrolid'=>$maninstance1->id)));
278
    }
278
    }
Línea 279... Línea 279...
279
 
279
 
280
    public function test_notification() {
280
    public function test_notification(): void {
281
        global $CFG, $DB;
281
        global $CFG, $DB;
Línea 282... Línea 282...
282
        $this->resetAfterTest();
282
        $this->resetAfterTest();
Línea 362... Línea 362...
362
        // Sent report to admin from self.
362
        // Sent report to admin from self.
363
        $this->assertEquals($admin->id, $messages[4]->useridto);
363
        $this->assertEquals($admin->id, $messages[4]->useridto);
364
        $this->assertEquals($admin->id, $messages[4]->useridfrom);
364
        $this->assertEquals($admin->id, $messages[4]->useridfrom);
365
    }
365
    }
Línea 366... Línea 366...
366
 
366
 
367
    public function test_expired() {
367
    public function test_expired(): void {
368
        global $DB;
368
        global $DB;
Línea 369... Línea 369...
369
        $this->resetAfterTest();
369
        $this->resetAfterTest();
370
 
370
 
Línea 478... Línea 478...
478
    }
478
    }
Línea 479... Línea 479...
479
 
479
 
480
    /**
480
    /**
481
     * Flatfile enrolment sync task test.
481
     * Flatfile enrolment sync task test.
482
     */
482
     */
483
    public function test_flatfile_sync_task() {
483
    public function test_flatfile_sync_task(): void {
484
        global $CFG, $DB;
484
        global $CFG, $DB;
Línea 485... Línea 485...
485
        $this->resetAfterTest();
485
        $this->resetAfterTest();
Línea 509... Línea 509...
509
    }
509
    }
Línea 510... Línea 510...
510
 
510
 
511
    /**
511
    /**
512
     * Test for getting user enrolment actions.
512
     * Test for getting user enrolment actions.
513
     */
513
     */
514
    public function test_get_user_enrolment_actions() {
514
    public function test_get_user_enrolment_actions(): void {
515
        global $CFG, $PAGE;
515
        global $CFG, $PAGE;
Línea 516... Línea 516...
516
        $this->resetAfterTest();
516
        $this->resetAfterTest();
517
 
517