MDL-77837 phpunit: Ensure that the cron user setter is used
When running an adhoc task in a unit test we should use the cron variant of the set user method to mimic the behaviour of a real cron run.
This commit is contained in:
@@ -733,7 +733,7 @@ abstract class advanced_testcase extends base_testcase {
|
||||
}
|
||||
|
||||
cron_prepare_core_renderer();
|
||||
$this->setUser($user);
|
||||
cron_setup_user($user);
|
||||
|
||||
$task->execute();
|
||||
\core\task\manager::adhoc_task_complete($task);
|
||||
|
||||
Reference in New Issue
Block a user