diff --git a/lib/behat/classes/util.php b/lib/behat/classes/util.php index 4941c5f0613..ae615de6b6b 100644 --- a/lib/behat/classes/util.php +++ b/lib/behat/classes/util.php @@ -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); diff --git a/reportbuilder/classes/manager.php b/reportbuilder/classes/manager.php index c46fe804272..680cb7b9abf 100644 --- a/reportbuilder/classes/manager.php +++ b/reportbuilder/classes/manager.php @@ -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 = []; } }