MDL-82162 tool: Switch to admin when executing runtestscenario by CLI

When the runtestscenario is executed via CLI, generators requiring a valid
$USER will fail.
This patch switches to the admin user, consistent with the approach used
in other simlar CLI scripts.
This commit is contained in:
Sara Arjona
2024-06-11 13:27:18 +02:00
parent db07c09afc
commit 96c159f032
@@ -118,6 +118,9 @@ if (!file_exists($featurefile)) {
exit(0);
}
// Switch to admin user account.
\core\session\manager::set_user(get_admin());
$runner = new tool_generator\local\testscenario\runner();
try {