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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user