From 95ff692b14a16ad90df44d4c45b40fc8cecde082 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 14 Mar 2024 15:06:52 -0700 Subject: [PATCH] Improve InteractsWithSettings name --- ...{InteractsWithSettings.php => InitializesSettings.php} | 2 +- tests/TestCase.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) rename tests/Support/{InteractsWithSettings.php => InitializesSettings.php} (90%) diff --git a/tests/Support/InteractsWithSettings.php b/tests/Support/InitializesSettings.php similarity index 90% rename from tests/Support/InteractsWithSettings.php rename to tests/Support/InitializesSettings.php index a8c0070188..7c08e6f897 100644 --- a/tests/Support/InteractsWithSettings.php +++ b/tests/Support/InitializesSettings.php @@ -4,7 +4,7 @@ namespace Tests\Support; use App\Models\Setting; -trait InteractsWithSettings +trait InitializesSettings { protected Settings $settings; diff --git a/tests/TestCase.php b/tests/TestCase.php index 9b77eeb328..8a3321ac62 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -8,14 +8,14 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use RuntimeException; use Tests\Support\CustomTestMacros; use Tests\Support\InteractsWithAuthentication; -use Tests\Support\InteractsWithSettings; +use Tests\Support\InitializesSettings; abstract class TestCase extends BaseTestCase { use CreatesApplication; use CustomTestMacros; use InteractsWithAuthentication; - use InteractsWithSettings; + use InitializesSettings; use LazilyRefreshDatabase; private array $globallyDisabledMiddleware = [ @@ -34,9 +34,7 @@ abstract class TestCase extends BaseTestCase $this->withoutMiddleware($this->globallyDisabledMiddleware); - if (collect(class_uses_recursive($this))->contains(InteractsWithSettings::class)) { - $this->initializeSettings(); - } + $this->initializeSettings(); $this->registerCustomMacros(); }