Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Class: quizaccess_seb_backup_restore_testcase  - X-Ref

PHPUnit tests for backup and restore functionality.

setUp()   X-Ref
Called before every test.


create_quiz_with_template()   X-Ref
A helper method to create a quiz with template usage of SEB.

return: \quizaccess_seb\quiz_settings

backup_and_restore_quiz()   X-Ref
A helper method to emulate backup and restore of the quiz.

return: \cm_info|null

backup_quiz()   X-Ref
A helper method to backup test quiz.

return: mixed A backup ID ready to be restored.

restore_quiz($backupid)   X-Ref
A helper method to restore provided backup.

param: string $backupid Backup ID to restore.

change_site()   X-Ref
A helper method to emulate restoring to a different site.


validate_backup_restore(cm_info $newcm)   X-Ref
A helper method to validate backup and restore results.

param: cm_info $newcm Restored course_module object.

test_backup_restore_no_seb()   X-Ref
Test backup and restore when no seb.


test_backup_restore_manual_config()   X-Ref
Test backup and restore when manually configured.


test_backup_restore_template_config()   X-Ref
Test backup and restore when using template.


test_backup_restore_uploaded_config()   X-Ref
Test backup and restore when using uploaded file.


test_restore_template_to_a_different_site_when_the_same_template_exists()   X-Ref
No new template should be restored if restoring to a different site,
but the template with  the same name and content exists..


test_restore_template_to_a_different_site_when_the_same_content_but_different_name()   X-Ref
A new template should be restored if restoring to a different site, but existing template
has the same content, but different name.


test_restore_template_to_a_different_site_when_the_same_name_but_different_content()   X-Ref
A new template should be restored if restoring to a different site, but existing template
has the same name, but different content.