Skip to content

A free open source IT asset/license management system

Clear the settings cache on app destruction

Marcus Moore6d594faae751
diff --git a/tests/Support/InteractsWithSettings.php b/tests/Support/InteractsWithSettings.php
index 1de9e7bc13..aae1aab9d9 100644
--- a/tests/Support/InteractsWithSettings.php
+++ b/tests/Support/InteractsWithSettings.php
@@ -2,6 +2,8 @@
namespace Tests\Support;
+use App\Models\Setting;
+
trait InteractsWithSettings
{
protected Settings $settings;
@@ -9,5 +11,7 @@ trait InteractsWithSettings
public function setUpSettings()
{
$this->settings = Settings::initialize();
+
+ $this->beforeApplicationDestroyed(fn() => Setting::$_cache = null);
}
}