Differences Between: [Versions 310 and 311] [Versions 39 and 311]
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: | 520 lines (23 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
cronhelper_test:: (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: cronhelper_test - X-Ref
Unit tests for backups cron helper.test_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. |