From 1afbb070371489b0b2c9a3bb9cba6ca7a0684126 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Thu, 7 Jan 2021 14:10:53 -0500 Subject: [PATCH] Tests: purge settings cache Some tests need to change settings, but since MemoryCacheSettingsRepository caches settings in-memory, those changes aren't reflected. The new `purgeSettingsCache` removes it from the container, eliminating that cache. For UserTest, we also need to regenerate the display name driver, since that's set statically on boot, before we'll get a change to clear the settings cache. --- .../tests/integration/UsesSettings.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 php-packages/testing/tests/integration/UsesSettings.php diff --git a/php-packages/testing/tests/integration/UsesSettings.php b/php-packages/testing/tests/integration/UsesSettings.php new file mode 100644 index 000000000..d37aa0f7b --- /dev/null +++ b/php-packages/testing/tests/integration/UsesSettings.php @@ -0,0 +1,25 @@ +app()->getContainer()->forgetInstance(SettingsRepositoryInterface::class); + } +}