MDL-73592 phpunit: Run adhoc tasks after install

This commit is contained in:
Shamim Rezaie 2022-02-18 01:51:47 +11:00
parent b36a1f9ee0
commit 7015cbf75f
2 changed files with 12 additions and 0 deletions

View File

@ -132,6 +132,12 @@ class behat_util extends testing_util {
set_config('curlsecurityblockedhosts', '');
set_config('curlsecurityallowedport', '');
// Execute all the adhoc tasks.
while ($task = \core\task\manager::get_next_adhoc_task(time())) {
$task->execute();
\core\task\manager::adhoc_task_complete($task);
}
// Keeps the current version of database and dataroot.
self::store_versions_hash();

View File

@ -477,6 +477,12 @@ class phpunit_util extends testing_util {
set_config('curlsecurityblockedhosts', '');
set_config('curlsecurityallowedport', '');
// Execute all the adhoc tasks.
while ($task = \core\task\manager::get_next_adhoc_task(time())) {
$task->execute();
\core\task\manager::adhoc_task_complete($task);
}
// We need to keep the installed dataroot filedir files.
// So each time we reset the dataroot before running a test, the default files are still installed.
self::save_original_data_files();