From 75fc624ec65da9690adb6eed6d1256e16fef1454 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 2 Mar 2023 13:12:25 -0800 Subject: [PATCH] Globally disable SecurityHeaders in tests --- tests/TestCase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 5082341307..4a19344eb3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,6 +2,7 @@ namespace Tests; +use App\Http\Middleware\SecurityHeaders; use App\Models\Setting; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; @@ -9,10 +10,16 @@ abstract class TestCase extends BaseTestCase { use CreatesApplication; + private array $globallyDisabledMiddleware = [ + SecurityHeaders::class, + ]; + protected function setUp(): void { parent::setUp(); $this->beforeApplicationDestroyed(fn() => Setting::$_cache = null); + + $this->withoutMiddleware($this->globallyDisabledMiddleware); } }