Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310]

This file contains the unittests for scheduled tasks.

Copyright: 2013 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 611 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/tests/fixtures/task_fixtures.php

Defines 1 class


Class: core_scheduled_task_testcase  - X-Ref

Test class for scheduled task.

test_eval_cron_field()   X-Ref
Test the cron scheduling method


test_get_next_scheduled_time()   X-Ref
No description

test_timezones()   X-Ref
No description

test_reset_scheduled_tasks_for_component_customised()   X-Ref
No description

test_reset_scheduled_tasks_for_component_deleted()   X-Ref
No description

test_reset_scheduled_tasks_for_component_changed_in_source()   X-Ref
No description

test_reset_scheduled_tasks_for_component_delete()   X-Ref
Tests that the reset function deletes old tasks.


test_get_next_scheduled_task()   X-Ref
No description

test_get_broken_scheduled_task()   X-Ref
No description

test_random_time_specification()   X-Ref
Tests the use of 'R' syntax in time fields of tasks to get
tasks be configured with a non-uniform time.


test_file_temp_cleanup_task()   X-Ref
Test that the file_temp_cleanup_task removes directories and
files as expected.


test_clear_fail_delay()   X-Ref
Test that the function to clear the fail delay from a task works correctly.


assertTaskEquals(\core\task\task_base $task, \core\task\task_base $comparisontask)   X-Ref
Assert that the specified tasks are equal.

param: \core\task\task_base $task
param: \core\task\task_base $comparisontask

assertTaskNotEquals(\core\task\task_base $task, \core\task\task_base $comparisontask)   X-Ref
Assert that the specified tasks are not equal.

param: \core\task\task_base $task
param: \core\task\task_base $comparisontask

test_reset_scheduled_tasks_for_component_keeps_original_lastruntime()   X-Ref
Assert that the lastruntime column holds an original value after a scheduled task is reset.