diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 1fa42d4a46c..4b10ce061f0 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -655,6 +655,9 @@ class phpunit_util { if (class_exists('available_update_checker')) { available_update_checker::reset_caches(true); } + if (class_exists('available_update_deployer')) { + available_update_deployer::reset_caches(true); + } // purge dataroot directory self::reset_dataroot(); diff --git a/lib/pluginlib.php b/lib/pluginlib.php index 4d69ffe60ae..e3878476635 100644 --- a/lib/pluginlib.php +++ b/lib/pluginlib.php @@ -1469,6 +1469,17 @@ class available_update_deployer { return self::$singletoninstance; } + /** + * Reset caches used by this script + * + * @param bool $phpunitreset is this called as a part of PHPUnit reset? + */ + public static function reset_caches($phpunitreset = false) { + if ($phpunitreset) { + self::$singletoninstance = null; + } + } + /** * Is automatic deployment enabled? *