mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Globally disable SecurityHeaders in tests
This commit is contained in:
parent
4197e613b2
commit
75fc624ec6
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Tests;
|
namespace Tests;
|
||||||
|
|
||||||
|
use App\Http\Middleware\SecurityHeaders;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||||
|
|
||||||
|
@ -9,10 +10,16 @@ abstract class TestCase extends BaseTestCase
|
||||||
{
|
{
|
||||||
use CreatesApplication;
|
use CreatesApplication;
|
||||||
|
|
||||||
|
private array $globallyDisabledMiddleware = [
|
||||||
|
SecurityHeaders::class,
|
||||||
|
];
|
||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->beforeApplicationDestroyed(fn() => Setting::$_cache = null);
|
$this->beforeApplicationDestroyed(fn() => Setting::$_cache = null);
|
||||||
|
|
||||||
|
$this->withoutMiddleware($this->globallyDisabledMiddleware);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue