From 469eef4e6fb11de778088d10d76e7de3ea87a305 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 26 Oct 2023 14:40:18 +0900 Subject: [PATCH] feat: add reset() for testing --- system/Config/BaseConfig.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index 7daa6e1544c0..5dd6cde2ad02 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -83,6 +83,18 @@ public static function setModules(Modules $modules): void static::$moduleConfig = $modules; } + /** + * @internal For testing purposes only. + * @testTag + */ + public static function reset(): void + { + static::$registrars = []; + static::$override = true; + static::$didDiscovery = false; + static::$moduleConfig = null; + } + /** * Will attempt to get environment variables with names * that match the properties of the child class.