Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Class: restore_test  - X-Ref

Course restore testcase.

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

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

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

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

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

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.
return: stdClass The updated course object.

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

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.
return: stdClass The updated course object.

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

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

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

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.
return: stdClass The updated course object.

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

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.
return: stdClass The updated course object.

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

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

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