MDL-72873 core_grades: Create method that resets all static caches

Creates a new method reset_caches() in grade_helper which resets
all static caches within this class. This is required for unit
testing.
This commit is contained in:
Mihail Geshoski 2021-12-01 16:04:06 +08:00
parent 17bfe7e79f
commit b4e8e0a50d

View File

@ -3244,5 +3244,23 @@ abstract class grade_helper {
}
return $result;
}
/**
* Resets all static caches.
*
* @return void
*/
public static function reset_caches() {
self::$managesetting = null;
self::$gradereports = null;
self::$gradereportpreferences = null;
self::$scaleinfo = null;
self::$outcomeinfo = null;
self::$letterinfo = null;
self::$importplugins = null;
self::$exportplugins = null;
self::$pluginstrings = null;
self::$aggregationstrings = null;
}
}