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]

Backup and restore actions to help behat feature files writting.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 382 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 4 files
 lib/behat/behat_field_manager.php
 lib/behat/form_field/behat_form_field.php
 lib/behat/behat_base.php
 lib/tests/behat/behat_navigation.php

Defines 1 class


Class: behat_backup  - X-Ref

Backup-related steps definitions.

i_backup_course_using_this_options($backupcourse, $options = false)   X-Ref
Backups the specified course using the provided options. If you are interested in restoring this backup would be
useful to provide a 'Filename' option.

param: string $backupcourse
param: TableNode $options Backup options or false if no options provided

i_perform_a_quick_backup_of_course($backupcourse)   X-Ref
Performs a quick (one click) backup of a course.

Please note that because you can't set settings with this there is no way to know what the filename
that was produced was. It contains a timestamp making it hard to find.

param: string $backupcourse

i_import_course_into_course($fromcourse, $tocourse, $options = false)   X-Ref
Imports the specified origin course into the other course using the provided options.

Keeping it separatelly from backup & restore, it the number of
steps and duplicate code becomes bigger a common method should
be generalized.

param: string $fromcourse
param: string $tocourse
param: TableNode $options

i_restore_backup_into_course_using_this_options($backupfilename, $existingcourse, $options = false)   X-Ref
Restores the backup into the specified course and the provided options.

You should be in the 'Restore' page where the backup is.

param: string $backupfilename
param: string $existingcourse
param: TableNode $options Restore forms options or false if no options provided

i_restore_backup_into_a_new_course_using_this_options($backupfilename, $options = false)   X-Ref
Restores the specified backup into a new course using the provided options.

You should be in the 'Restore' page where the backup is.

param: string $backupfilename
param: TableNode $options Restore forms options or false if no options provided

i_merge_backup_into_the_current_course($backupfilename, $options = false)   X-Ref
Merges the backup into the current course using the provided restore options.

You should be in the 'Restore' page where the backup is.

param: string $backupfilename
param: TableNode $options Restore forms options or false if no options provided

i_merge_backup_into_current_course_deleting_its_contents($backupfilename, $options = false)   X-Ref
Merges the backup into the current course after deleting this contents, using the provided restore options.

You should be in the 'Restore' page where the backup is.

param: string $backupfilename
param: TableNode $options Restore forms options or false if no options provided

select_backup($backupfilename)   X-Ref
Selects the backup to restore.

param: string $backupfilename
return: void

process_restore($options)   X-Ref
Executes the common steps of all restore processes.

param: TableNode $options The backup and restore options or false if no options provided
return: void

fill_backup_restore_form($options)   X-Ref
Tries to fill the current page form elements with the provided options.

This step is slow as it spins over each provided option, we are
not expected to have lots of provided options, anyways, is better
to be conservative and wait for the elements to appear rather than
to have false failures.

param: TableNode $options The backup and restore options or false if no options provided
return: void

get_step_options($options, $step)   X-Ref
Get the options specific to this step of the backup/restore process.

param: TableNode $options The options table to filter
param: string $step The name of the step
return: TableNode The filtered options table