1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 13:54:03 +00:00

Clean up global state in tests

This commit is contained in:
Samuel Štancl 2020-05-22 20:08:50 +02:00
parent 4256b9eba6
commit f0ff8248e7

View file

@ -20,14 +20,19 @@ class RequestDataIdentificationTest extends TestCase
], ],
]); ]);
InitializeTenancyByRequestData::$header = 'X-Tenant';
InitializeTenancyByRequestData::$queryParameter = 'tenant';
Route::middleware(InitializeTenancyByRequestData::class)->get('/test', function () { Route::middleware(InitializeTenancyByRequestData::class)->get('/test', function () {
return 'Tenant id: ' . tenant('id'); return 'Tenant id: ' . tenant('id');
}); });
} }
public function tearDown(): void
{
InitializeTenancyByRequestData::$header = 'X-Tenant';
InitializeTenancyByRequestData::$queryParameter = 'tenant';
parent::tearDown();
}
/** @test */ /** @test */
public function header_identification_works() public function header_identification_works()
{ {