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.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

(no description)

File Size: 384 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: backup_test  - X-Ref

Class core_question_backup_testcase

backup_course($course)   X-Ref
Makes a backup of the course.

param: \stdClass $course The course object.
return: string Unique identifier for this backup.

restore_course($backupid, $fullname, $shortname, $categoryid, $expectedprecheckwarning = [])   X-Ref
Restores a backup that has been made earlier.

param: string $backupid The unique identifier of the backup.
param: string $fullname Full name of the new course that is going to be created.
param: string $shortname Short name of the new course that is going to be created.
param: int $categoryid The course category the backup is going to be restored in.
param: string[] $expectedprecheckwarning
return: int The new course id.

test_backup_question_tags()   X-Ref
This function tests backup and restore of question tags and course level question tags.


test_backup_question_author_retained_when_enrolled()   X-Ref
Test that the question author is retained when they are enrolled in to the course.


test_backup_question_author_retained_when_not_enrolled()   X-Ref
Test that the question author is retained when they are not enrolled in to the course,
but we are restoring the backup at the same site.


test_backup_question_author_reset()   X-Ref
Test that the current user is set as a question author when we are restoring the backup
at the another site and the question author is not enrolled in to the course.