Differences Between: [Versions 310 and 402] [Versions 39 and 402]
(no description)
File Size: | 180 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
roles_backup_restore_test:: (7 methods):
create_course_with_role_overrides()
get_role()
get_overrides_for_role_on_context()
backup_course()
restore_adding_to_course()
test_restore_role_overrides_as_manager()
test_restore_role_overrides_as_teacher()
Class: roles_backup_restore_test - X-Ref
Unit tests for how backup and restore handles role-related things.create_course_with_role_overrides() X-Ref |
Create a course where the (non-editing) Teacher role is overridden to have 'moodle/user:loginas' and 'moodle/site:accessallgroups'. return: stdClass the new course. |
get_role(string $shortname) X-Ref |
Get the role id from a shortname. param: string $shortname the role shortname. return: stdClass the role from the DB. |
get_overrides_for_role_on_context(string $shortname, context $context) X-Ref |
Get an array capability => CAP_... constant for all the orverrides set for a given role on a given context. param: string $shortname role shortname. param: context $context context. return: array the overrides set here. |
backup_course(\stdClass $course) X-Ref |
Makes a backup of the course. param: stdClass $course The course object. return: string Unique identifier for this backup. |
restore_adding_to_course(string $backupid, string $asroleshortname) X-Ref |
Restores a backup that has been made earlier. param: string $backupid The unique identifier of the backup. param: string $asroleshortname Which role in the new cousre the restorer should have. return: int The new course id. |
test_restore_role_overrides_as_manager() X-Ref |
No description |
test_restore_role_overrides_as_teacher() X-Ref |
No description |