Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 44... Línea 44...
44
        global $CFG;
44
        global $CFG;
45
        require_once($CFG->dirroot . '/course/lib.php');
45
        require_once($CFG->dirroot . '/course/lib.php');
46
        require_once($CFG->libdir . '/tests/fixtures/sectiondelegatetest.php');
46
        require_once($CFG->libdir . '/tests/fixtures/sectiondelegatetest.php');
47
    }
47
    }
Línea 48... Línea 48...
48
 
48
 
49
    public function test_section_info_properties() {
49
    public function test_section_info_properties(): void {
Línea 50... Línea 50...
50
        global $DB, $CFG;
50
        global $DB, $CFG;
51
 
51
 
52
        $this->resetAfterTest();
52
        $this->resetAfterTest();
Línea 112... Línea 112...
112
        // Restore settings.
112
        // Restore settings.
113
        set_config('enableavailability', $oldcfgenableavailability);
113
        set_config('enableavailability', $oldcfgenableavailability);
114
        set_config('enablecompletion', $oldcfgenablecompletion);
114
        set_config('enablecompletion', $oldcfgenablecompletion);
115
    }
115
    }
Línea 116... Línea 116...
116
 
116
 
117
    public function test_cm_info_properties() {
117
    public function test_cm_info_properties(): void {
Línea 118... Línea 118...
118
        global $DB, $CFG;
118
        global $DB, $CFG;
119
 
119
 
120
        $this->resetAfterTest();
120
        $this->resetAfterTest();
Línea 246... Línea 246...
246
        // Restore settings.
246
        // Restore settings.
247
        set_config('enableavailability', $oldcfgenableavailability);
247
        set_config('enableavailability', $oldcfgenableavailability);
248
        set_config('enablecompletion', $oldcfgenablecompletion);
248
        set_config('enablecompletion', $oldcfgenablecompletion);
249
    }
249
    }
Línea 250... Línea 250...
250
 
250
 
251
    public function test_matching_cacherev() {
251
    public function test_matching_cacherev(): void {
Línea 252... Línea 252...
252
        global $DB, $CFG;
252
        global $DB, $CFG;
253
 
253
 
254
        $this->resetAfterTest();
254
        $this->resetAfterTest();
Línea 405... Línea 405...
405
        // Check that the in-memory $COURSE and $SITE have updated.
405
        // Check that the in-memory $COURSE and $SITE have updated.
406
        $this->assertEquals($newcourse->cacherev, $COURSE->cacherev);
406
        $this->assertEquals($newcourse->cacherev, $COURSE->cacherev);
407
        $this->assertEquals($newcourse->cacherev, $SITE->cacherev);
407
        $this->assertEquals($newcourse->cacherev, $SITE->cacherev);
408
    }
408
    }
Línea 409... Línea 409...
409
 
409
 
410
    public function test_course_modinfo_properties() {
410
    public function test_course_modinfo_properties(): void {
Línea 411... Línea 411...
411
        global $USER, $DB;
411
        global $USER, $DB;
412
 
412
 
Línea 489... Línea 489...
489
        $modinfo->cms = 'Illegal overwriting';
489
        $modinfo->cms = 'Illegal overwriting';
490
        $this->assertDebuggingCalled();
490
        $this->assertDebuggingCalled();
491
        $this->assertNotEquals('Illegal overwriting', $modinfo->cms);
491
        $this->assertNotEquals('Illegal overwriting', $modinfo->cms);
492
    }
492
    }
Línea 493... Línea 493...
493
 
493
 
494
    public function test_is_user_access_restricted_by_capability() {
494
    public function test_is_user_access_restricted_by_capability(): void {
Línea 495... Línea 495...
495
        global $DB;
495
        global $DB;
Línea 496... Línea 496...
496
 
496
 
Línea 547... Línea 547...
547
    }
547
    }
Línea 548... Línea 548...
548
 
548
 
549
    /**
549
    /**
550
     * Tests for function cm_info::get_course_module_record()
550
     * Tests for function cm_info::get_course_module_record()
551
     */
551
     */
552
    public function test_cm_info_get_course_module_record() {
552
    public function test_cm_info_get_course_module_record(): void {
Línea 553... Línea 553...
553
        global $DB;
553
        global $DB;
554
 
554
 
Línea 691... Línea 691...
691
 
691
 
692
    /**
692
    /**
693
     * Tests the availability property that has been added to course modules
693
     * Tests the availability property that has been added to course modules
694
     * and sections (just to see that it is correctly saved and accessed).
694
     * and sections (just to see that it is correctly saved and accessed).
695
     */
695
     */
696
    public function test_availability_property() {
696
    public function test_availability_property(): void {
Línea 697... Línea 697...
697
        global $DB, $CFG;
697
        global $DB, $CFG;
Línea 698... Línea 698...
698
 
698
 
Línea 737... Línea 737...
737
    }
737
    }
Línea 738... Línea 738...
738
 
738
 
739
    /**
739
    /**
740
     * Tests for get_groups() method.
740
     * Tests for get_groups() method.
741
     */
741
     */
742
    public function test_get_groups() {
742
    public function test_get_groups(): void {
743
        $this->resetAfterTest();
743
        $this->resetAfterTest();
Línea 744... Línea 744...
744
        $generator = $this->getDataGenerator();
744
        $generator = $this->getDataGenerator();
745
 
745
 
Línea 800... Línea 800...
800
    }
800
    }
Línea 801... Línea 801...
801
 
801
 
802
    /**
802
    /**
803
     * Tests the function for constructing a cm_info from mixed data.
803
     * Tests the function for constructing a cm_info from mixed data.
804
     */
804
     */
805
    public function test_create() {
805
    public function test_create(): void {
806
        global $CFG, $DB;
806
        global $CFG, $DB;
Línea 807... Línea 807...
807
        $this->resetAfterTest();
807
        $this->resetAfterTest();
808
 
808
 
Línea 859... Línea 859...
859
 
859
 
860
    /**
860
    /**
861
     * Tests function for getting $course and $cm at once quickly from modinfo
861
     * Tests function for getting $course and $cm at once quickly from modinfo
862
     * based on cmid or cm record.
862
     * based on cmid or cm record.
863
     */
863
     */
864
    public function test_get_course_and_cm_from_cmid() {
864
    public function test_get_course_and_cm_from_cmid(): void {
865
        global $CFG, $DB;
865
        global $CFG, $DB;
Línea 866... Línea 866...
866
        $this->resetAfterTest();
866
        $this->resetAfterTest();
867
 
867
 
Línea 952... Línea 952...
952
 
952
 
953
    /**
953
    /**
954
     * Tests function for getting $course and $cm at once quickly from modinfo
954
     * Tests function for getting $course and $cm at once quickly from modinfo
955
     * based on instance id or record.
955
     * based on instance id or record.
956
     */
956
     */
957
    public function test_get_course_and_cm_from_instance() {
957
    public function test_get_course_and_cm_from_instance(): void {
958
        global $CFG, $DB;
958
        global $CFG, $DB;
Línea 959... Línea 959...
959
        $this->resetAfterTest();
959
        $this->resetAfterTest();
960
 
960
 
Línea 1082... Línea 1082...
1082
    public function test_get_section_info_by_id(
1082
    public function test_get_section_info_by_id(
1083
        int $sectionnum,
1083
        int $sectionnum,
1084
        int $strictness = IGNORE_MISSING,
1084
        int $strictness = IGNORE_MISSING,
1085
        bool $expectnull = false,
1085
        bool $expectnull = false,
1086
        bool $expectexception = false
1086
        bool $expectexception = false
1087
    ) {
1087
    ): void {
1088
        global $DB;
1088
        global $DB;
Línea 1089... Línea 1089...
1089
 
1089
 
Línea 1090... Línea 1090...
1090
        $this->resetAfterTest();
1090
        $this->resetAfterTest();