Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 72... Línea 72...
72
        $testclass = new scheduled_test_task();
72
        $testclass = new scheduled_test_task();
Línea 73... Línea 73...
73
 
73
 
74
        $this->assertEquals($expected, $testclass->eval_cron_field($field, $min, $max));
74
        $this->assertEquals($expected, $testclass->eval_cron_field($field, $min, $max));
Línea 75... Línea 75...
75
    }
75
    }
76
 
76
 
77
    public function test_get_next_scheduled_time() {
77
    public function test_get_next_scheduled_time(): void {
Línea 78... Línea 78...
78
        global $CFG;
78
        global $CFG;
Línea 310... Línea 310...
310
        $this->assertEquals(strtotime('2023-10-29 02:00 GMT'), $four);
310
        $this->assertEquals(strtotime('2023-10-29 02:00 GMT'), $four);
311
        // This time is now unambiguous in Europe/London.
311
        // This time is now unambiguous in Europe/London.
312
        $this->assertEquals(strtotime('2023-10-29 02:00 Europe/London'), $four);
312
        $this->assertEquals(strtotime('2023-10-29 02:00 Europe/London'), $four);
313
    }
313
    }
Línea 314... Línea 314...
314
 
314
 
315
    public function test_timezones() {
315
    public function test_timezones(): void {
Línea 316... Línea 316...
316
        global $CFG, $USER;
316
        global $CFG, $USER;
317
 
317
 
Línea 423... Línea 423...
423
    }
423
    }
Línea 424... Línea 424...
424
 
424
 
425
    /**
425
    /**
426
     * Tests that the reset function deletes old tasks.
426
     * Tests that the reset function deletes old tasks.
427
     */
427
     */
428
    public function test_reset_scheduled_tasks_for_component_delete() {
428
    public function test_reset_scheduled_tasks_for_component_delete(): void {
429
        global $DB;
429
        global $DB;
Línea 430... Línea 430...
430
        $this->resetAfterTest(true);
430
        $this->resetAfterTest(true);
431
 
431
 
Línea 461... Línea 461...
461
            'component' => 'moodle')));
461
            'component' => 'moodle')));
462
        $this->assertFalse($DB->record_exists('task_scheduled', array('classname' => '\core\task\scheduled_test_task',
462
        $this->assertFalse($DB->record_exists('task_scheduled', array('classname' => '\core\task\scheduled_test_task',
463
            'component' => 'moodle')));
463
            'component' => 'moodle')));
464
    }
464
    }
Línea 465... Línea 465...
465
 
465
 
466
    public function test_get_next_scheduled_task() {
466
    public function test_get_next_scheduled_task(): void {
Línea 467... Línea 467...
467
        global $DB;
467
        global $DB;
468
 
468
 
469
        $this->resetAfterTest(true);
469
        $this->resetAfterTest(true);
Línea 546... Línea 546...
546
        // Should not get any task.
546
        // Should not get any task.
547
        $task = manager::get_next_scheduled_task($now);
547
        $task = manager::get_next_scheduled_task($now);
548
        $this->assertNull($task);
548
        $this->assertNull($task);
549
    }
549
    }
Línea 550... Línea 550...
550
 
550
 
551
    public function test_get_broken_scheduled_task() {
551
    public function test_get_broken_scheduled_task(): void {
Línea 552... Línea 552...
552
        global $DB;
552
        global $DB;
553
 
553
 
554
        $this->resetAfterTest(true);
554
        $this->resetAfterTest(true);
Línea 578... Línea 578...
578
 
578
 
579
    /**
579
    /**
580
     * Tests the use of 'R' syntax in time fields of tasks to get
580
     * Tests the use of 'R' syntax in time fields of tasks to get
581
     * tasks be configured with a non-uniform time.
581
     * tasks be configured with a non-uniform time.
582
     */
582
     */
Línea 583... Línea 583...
583
    public function test_random_time_specification() {
583
    public function test_random_time_specification(): void {
584
 
584
 
585
        // Testing non-deterministic things in a unit test is not really
585
        // Testing non-deterministic things in a unit test is not really
Línea 616... Línea 616...
616
 
616
 
617
    /**
617
    /**
618
     * Test that the file_temp_cleanup_task removes directories and
618
     * Test that the file_temp_cleanup_task removes directories and
619
     * files as expected.
619
     * files as expected.
620
     */
620
     */
621
    public function test_file_temp_cleanup_task() {
621
    public function test_file_temp_cleanup_task(): void {
622
        global $CFG;
622
        global $CFG;
Línea 623... Línea 623...
623
        $backuptempdir = make_backup_temp_directory('');
623
        $backuptempdir = make_backup_temp_directory('');
624
 
624
 
Línea 675... Línea 675...
675
    }
675
    }
Línea 676... Línea 676...
676
 
676
 
677
    /**
677
    /**
678
     * Test that the function to clear the fail delay from a task works correctly.
678
     * Test that the function to clear the fail delay from a task works correctly.
679
     */
679
     */
Línea 680... Línea 680...
680
    public function test_clear_fail_delay() {
680
    public function test_clear_fail_delay(): void {
Línea 681... Línea 681...
681
 
681
 
682
        $this->resetAfterTest();
682
        $this->resetAfterTest();