Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]
Unit tests for backups cron helper.
Copyright: | 2012 Frédéric Massart <fred@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 510 lines (23 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
backup_cron_helper_testcase:: (6 methods):
test_next_automated_backup()
test_get_backups_to_delete()
test_is_course_modified()
course_setup()
test_get_courses()
test_get_courses_starttime()
testable_backup_cron_automated_helper:: (3 methods):
testable_get_backups_to_delete()
testable_is_course_modified()
testable_get_courses()
Class: backup_cron_helper_testcase - X-Ref
Unit tests for backup cron helpertest_next_automated_backup() X-Ref |
Test {@link backup_cron_automated_helper::calculate_next_automated_backup}. |
test_get_backups_to_delete() X-Ref |
Test {@link backup_cron_automated_helper::get_backups_to_delete}. |
test_is_course_modified() X-Ref |
Test {@link backup_cron_automated_helper::is_course_modified}. |
course_setup() X-Ref |
Create courses and backup records for tests. return: array Created courses. |
test_get_courses() X-Ref |
Test the selection and ordering of courses to be backed up. |
test_get_courses_starttime() X-Ref |
Test the selection and ordering of courses to be backed up. Where it is not yet time to start backups for courses with existing backups. |
Class: testable_backup_cron_automated_helper - X-Ref
Provides access to protected methods we want to explicitly testtestable_get_backups_to_delete($backupfiles, $now) X-Ref |
Provides access to protected method get_backups_to_remove. param: array $backupfiles Existing backup files param: int $now Starting time of the process return: array Backup files to remove |
testable_is_course_modified($courseid, $since) X-Ref |
Provides access to protected method get_backups_to_remove. param: int $courseid course id to check param: int $since timestamp, from which to check return: bool true if the course was modified, false otherwise. This also returns false if no readers are enabled. This is |
testable_get_courses($now) X-Ref |
Provides access to protected method get_courses. param: int $now Timestamp to use. return: moodle_recordset The returned courses as a Moodle recordest. |