MDL-87034 hub: Reset hub registration caches during tests

This commit is contained in:
Juan Leyva
2025-12-11 09:01:46 +01:00
parent 475fea4b46
commit 459ad05ea2
2 changed files with 10 additions and 0 deletions
+7
View File
@@ -961,4 +961,11 @@ class registration {
$size = $size / (1024 * 1024);
return round($size, 3);
}
/**
* Resets the static caches for unit tests.
*/
public static function reset_caches(): void {
self::$registration = null;
}
}
+3
View File
@@ -245,6 +245,9 @@ class phpunit_util extends testing_util {
core_calendar\local\event\container::reset_caches();
}
// Reset hub registration caches.
\core\hub\registration::reset_caches();
// TODO MDL-25290: add more resets here and probably refactor them to new core function.
// Reset course and module caches.