mirror of
https://github.com/moodle/moodle.git
synced 2025-04-11 19:42:35 +02:00
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:
parent
d3ae1391ab
commit
215a887629
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user