From 4fa4bb7f7234fee38ed3d06b3316276375ca055a Mon Sep 17 00:00:00 2001 From: Adam Olley Date: Tue, 16 Apr 2024 11:50:14 +0930 Subject: [PATCH] MDL-81553 phpunit: Move controller->destroy() to after its needed We need to cleanup the controller _after_ we're using the step related to it. Destroying it before reintroduces the original issue from MDL-80553. --- backup/moodle2/tests/backup_stepslib_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup/moodle2/tests/backup_stepslib_test.php b/backup/moodle2/tests/backup_stepslib_test.php index deaa21288cb..fe55452f00b 100644 --- a/backup/moodle2/tests/backup_stepslib_test.php +++ b/backup/moodle2/tests/backup_stepslib_test.php @@ -71,11 +71,11 @@ class backup_stepslib_test extends \advanced_testcase { break; } } - $bc->destroy(); $reflection = new \ReflectionClass($step); $method = $reflection->getMethod('define_structure'); $structure = $method->invoke($step); + $bc->destroy(); $elements = $structure->get_final_elements(); $this->assertArrayHasKey('number', $elements);