Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Class: restore_test  - X-Ref

Course restore testcase.

backup_course($courseid, $userid = 2)   X-Ref
Backup a course and return its backup ID.

return: string
param: int $courseid The course ID.
param: int $userid The user doing the backup.

create_role_with_caps($caps, $perm)   X-Ref
Create a role with capabilities and permissions.

return: int The new role ID.
param: string|array $caps Capability names.
param: int $perm Constant CAP_* to apply to the capabilities.

restore_course($backupid, $courseid, $userid)   X-Ref
Restore a course.

return: stdClass The updated course object.
param: int $backupid The backup ID.
param: int $courseid The course ID to restore in, or 0.
param: int $userid The ID of the user performing the restore.

restore_to_existing_course($backupid, $courseid, $userid = 2)   X-Ref
Restore a course to an existing course.

return: stdClass The updated course object.
param: int $backupid The backup ID.
param: int $courseid The course ID to restore in.
param: int $userid The ID of the user performing the restore.

restore_to_new_course($backupid, $userid = 2)   X-Ref
Restore a course to a new course.

return: stdClass The new course object.
param: int $backupid The backup ID.
param: int $userid The ID of the user performing the restore.

async_restore_course($backupid, $courseid, $userid, $target)   X-Ref
Restore a course.

return: stdClass The updated course object.
param: int $backupid The backup ID.
param: int $courseid The course ID to restore in, or 0.
param: int $userid The ID of the user performing the restore.
param: int $target THe target of the restore.

async_restore_to_existing_course($backupid, $courseid,$userid = 2, $target = backup::TARGET_CURRENT_ADDING)   X-Ref
Restore a course to an existing course.

return: stdClass The updated course object.
param: int $backupid The backup ID.
param: int $courseid The course ID to restore in.
param: int $userid The ID of the user performing the restore.
param: int $target The type of restore we are performing.

async_restore_to_new_course($backupid, $userid = 2)   X-Ref
Restore a course to a new course.

return: stdClass The new course object.
param: int $backupid The backup ID.
param: int $userid The ID of the user performing the restore.

test_async_restore_existing_idnumber_in_new_course()   X-Ref
No description

test_async_restore_course_info_in_existing_course()   X-Ref
No description

test_async_restore_course_info_in_existing_course_delete_first()   X-Ref
No description

test_restore_existing_idnumber_in_new_course()   X-Ref
No description

test_restore_non_existing_idnumber_in_new_course()   X-Ref
No description

test_restore_existing_idnumber_in_existing_course()   X-Ref
No description

test_restore_non_existing_idnumber_in_existing_course()   X-Ref
No description

test_restore_idnumber_in_existing_course_without_permissions()   X-Ref
No description

test_restore_course_info_in_new_course()   X-Ref
No description

test_restore_course_info_in_existing_course()   X-Ref
No description

test_restore_course_shortname_in_existing_course_without_permissions()   X-Ref
No description

test_restore_course_fullname_in_existing_course_without_permissions()   X-Ref
No description

test_restore_course_summary_in_existing_course_without_permissions()   X-Ref
No description

test_restore_course_startdate_in_existing_course_without_permissions()   X-Ref
No description

test_restore_editor_courseformat()   X-Ref
Tests course restore with editor in course format.

author: Matthew Hilton