Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 30... Línea 30...
30
    }
30
    }
Línea 31... Línea 31...
31
 
31
 
32
    /**
32
    /**
33
     * Tests the info_module class (is_available, get_full_information).
33
     * Tests the info_module class (is_available, get_full_information).
34
     */
34
     */
35
    public function test_info_module() {
35
    public function test_info_module(): void {
Línea 36... Línea 36...
36
        global $DB, $CFG;
36
        global $DB, $CFG;
37
 
37
 
38
        // Create a course and pages.
38
        // Create a course and pages.
Línea 89... Línea 89...
89
    }
89
    }
Línea 90... Línea 90...
90
 
90
 
91
    /**
91
    /**
92
     * Tests the info_section class (is_available, get_full_information).
92
     * Tests the info_section class (is_available, get_full_information).
93
     */
93
     */
94
    public function test_info_section() {
94
    public function test_info_section(): void {
Línea 95... Línea 95...
95
        global $DB;
95
        global $DB;
96
 
96
 
97
        // Create a course.
97
        // Create a course.
Línea 143... Línea 143...
143
    }
143
    }
Línea 144... Línea 144...
144
 
144
 
145
    /**
145
    /**
146
     * Tests the is_user_visible() static function in info_module.
146
     * Tests the is_user_visible() static function in info_module.
147
     */
147
     */
148
    public function test_is_user_visible() {
148
    public function test_is_user_visible(): void {
149
        global $CFG, $DB;
149
        global $CFG, $DB;
150
        require_once($CFG->dirroot . '/course/lib.php');
150
        require_once($CFG->dirroot . '/course/lib.php');
151
        $this->resetAfterTest();
151
        $this->resetAfterTest();
Línea 241... Línea 241...
241
    }
241
    }
Línea 242... Línea 242...
242
 
242
 
243
    /**
243
    /**
244
     * Tests the convert_legacy_fields function used in restore.
244
     * Tests the convert_legacy_fields function used in restore.
245
     */
245
     */
246
    public function test_convert_legacy_fields() {
246
    public function test_convert_legacy_fields(): void {
247
        // Check with no availability conditions first.
247
        // Check with no availability conditions first.
248
        $rec = (object)array('availablefrom' => 0, 'availableuntil' => 0,
248
        $rec = (object)array('availablefrom' => 0, 'availableuntil' => 0,
249
                'groupingid' => 7, 'showavailability' => 1);
249
                'groupingid' => 7, 'showavailability' => 1);
Línea 308... Línea 308...
308
    }
308
    }
Línea 309... Línea 309...
309
 
309
 
310
    /**
310
    /**
311
     * Tests the add_legacy_availability_condition function used in restore.
311
     * Tests the add_legacy_availability_condition function used in restore.
312
     */
312
     */
313
    public function test_add_legacy_availability_condition() {
313
    public function test_add_legacy_availability_condition(): void {
314
        // Completion condition tests.
314
        // Completion condition tests.
315
        $rec = (object)array('sourcecmid' => 7, 'requiredcompletion' => 1);
315
        $rec = (object)array('sourcecmid' => 7, 'requiredcompletion' => 1);
316
        // No previous availability, show = true.
316
        // No previous availability, show = true.
317
        $this->assertEquals(
317
        $this->assertEquals(
Línea 352... Línea 352...
352
    }
352
    }
Línea 353... Línea 353...
353
 
353
 
354
    /**
354
    /**
355
     * Tests the add_legacy_availability_field_condition function used in restore.
355
     * Tests the add_legacy_availability_field_condition function used in restore.
356
     */
356
     */
357
    public function test_add_legacy_availability_field_condition() {
357
    public function test_add_legacy_availability_field_condition(): void {
358
        // User field, normal operator.
358
        // User field, normal operator.
359
        $rec = (object)array('userfield' => 'email', 'shortname' => null,
359
        $rec = (object)array('userfield' => 'email', 'shortname' => null,
360
                'operator' => 'contains', 'value' => '@');
360
                'operator' => 'contains', 'value' => '@');
361
        $this->assertEquals(
361
        $this->assertEquals(
Línea 381... Línea 381...
381
    }
381
    }
Línea 382... Línea 382...
382
 
382
 
383
    /**
383
    /**
384
     * Tests the filter_user_list() and get_user_list_sql() functions.
384
     * Tests the filter_user_list() and get_user_list_sql() functions.
385
     */
385
     */
386
    public function test_filter_user_list() {
386
    public function test_filter_user_list(): void {
387
        global $CFG, $DB;
387
        global $CFG, $DB;
388
        require_once($CFG->dirroot . '/course/lib.php');
388
        require_once($CFG->dirroot . '/course/lib.php');
389
        $this->resetAfterTest();
389
        $this->resetAfterTest();
Línea 501... Línea 501...
501
    }
501
    }
Línea 502... Línea 502...
502
 
502
 
503
    /**
503
    /**
504
     * Tests the info_module class when involved in a recursive call to $cm->name.
504
     * Tests the info_module class when involved in a recursive call to $cm->name.
505
     */
505
     */
506
    public function test_info_recursive_name_call() {
506
    public function test_info_recursive_name_call(): void {
Línea 507... Línea 507...
507
        global $DB;
507
        global $DB;
Línea 508... Línea 508...
508
 
508
 
Línea 531... Línea 531...
531
 
531
 
532
    /**
532
    /**
533
     * Test for the is_available_for_all() method of the info base class.
533
     * Test for the is_available_for_all() method of the info base class.
534
     * @covers \core_availability\info_module::is_available_for_all
534
     * @covers \core_availability\info_module::is_available_for_all
535
     */
535
     */
536
    public function test_is_available_for_all() {
536
    public function test_is_available_for_all(): void {
537
        global $CFG, $DB;
537
        global $CFG, $DB;
538
        $this->resetAfterTest();
538
        $this->resetAfterTest();
Línea 539... Línea 539...
539
        $CFG->enableavailability = 0;
539
        $CFG->enableavailability = 0;