-
Functional Test
-
Minor
-
Moodle 4.5
This test requires
- Server access to be able to run command line interface (CLI) scripts
- Several Moodle course backup files, especially large backups including user data
- Open the console and run the command: php admin/cli/restore_backup.php
- Verify that the output looks like:
Restore backup into provided category or course.
If courseid is set, course module/s will be added into the course.
Options:
-f, --file=STRING Path to the backup file.
-c, --categoryid=INT ID of the course category to restore to.
-C, --courseid=INT ID of the course to restore to. This option is ignored if categoryid is set.
-s, --showdebugging Show developer level debugging information
-h, --help Print out this help.
- Run the command with path to a file that doesn't exist.
- Verify that the output states that the requested file could not be found.
- Run the command with path to the backup file correctly set and the category id set to 1:
- Verify that the output states that the course is restored.
- Log in to the Moodle site and verify that the course is restored into the correct category and activities and resources are correctly restored.
- If the backup file contained user data, verify that the user data is also correctly restored.
- Repeat steps 5 - 8 with more backup files and different category ids.
- is a QA test written for
-
MDL-69307 Add CLI script to restore a course from backup file
- Closed