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:23:40 +02:00
parent d3ae1391ab
commit 215a887629
No known key found for this signature in database

View File

@ -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 {