Globally disable SecurityHeaders in tests

This commit is contained in:
Marcus Moore 2023-03-02 13:12:25 -08:00
parent 4197e613b2
commit 75fc624ec6
No known key found for this signature in database

View file

@ -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);
}
}