MDL-74548 backup: Unit tests for course copy refactor

This commit is contained in:
Cameron Ball
2022-06-29 09:35:58 +08:00
parent 53dd76348c
commit 8516a494b6
2 changed files with 227 additions and 6 deletions
@@ -71,6 +71,19 @@ class controller_test extends \advanced_testcase {
$CFG->backup_file_logger_level_extra = backup::LOG_NONE;
}
/**
* Test get_copy
*
* @covers \restore_controller::get_copy
*/
public function test_restore_controller_get_copy() {
$copydata = (object)["some" => "copydata"];
$rc = new \restore_controller(1729, $this->courseid, backup::INTERACTIVE_NO, backup::MODE_COPY,
$this->userid, backup::TARGET_NEW_COURSE, null, backup::RELEASESESSION_NO, $copydata);
$this->assertEquals($copydata, $rc->get_copy());
}
/**
* Test instantiating a restore controller for a course copy without providing copy data.
*