Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401]

(no description)

File Size: 393 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.