This commit is contained in:
Eloy Lafuente (stronk7) 2021-11-04 12:52:38 +01:00
commit 7faf678b59
2 changed files with 4 additions and 2 deletions

View File

@ -414,6 +414,8 @@ class behat_util extends testing_util {
filter_manager::reset_caches();
\core_reportbuilder\manager::reset_caches();
// Reset course and module caches.
core_courseformat\base::reset_course_cache(0);
get_fast_modinfo(0, 0, true);

View File

@ -67,10 +67,10 @@ class manager {
}
/**
* Run reset code after unit tests to reset the instance cache
* Run reset code after tests to reset the instance cache
*/
public static function reset_caches(): void {
if (PHPUNIT_TEST) {
if (PHPUNIT_TEST || defined('BEHAT_TEST')) {
static::$instances = [];
}
}