MDL-87034 hub: Reset hub registration caches during tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user