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.
This commit is contained in:
Adam Olley
2024-04-16 11:50:14 +09:30
parent 8cf14f6e70
commit 4fa4bb7f72
@@ -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);