1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-09-20 12:34:03 +00:00

Add afterEach cleanup to TenantAssetTest

This commit is contained in:
lukinovec 2026-08-20 16:44:08 +02:00 committed by Samuel Stancl
parent 5e54e3e7d9
commit 9403d8c8fd

View file

@ -41,6 +41,12 @@ beforeEach(function () {
Event::listen(TenancyEnded::class, RevertToCentralContext::class); Event::listen(TenancyEnded::class, RevertToCentralContext::class);
}); });
afterEach(function () {
TenantAssetController::$headers = [];
TenantAssetController::$publicDisk = null;
InitializeTenancyByRequestData::$onFail = null;
});
test('asset can be accessed using the url returned by the tenant asset helper', function () { test('asset can be accessed using the url returned by the tenant asset helper', function () {
config(['tenancy.identification.default_middleware' => InitializeTenancyByRequestData::class]); config(['tenancy.identification.default_middleware' => InitializeTenancyByRequestData::class]);
@ -229,8 +235,6 @@ test('TenantAssetController headers are configurable', function () {
$response->assertSuccessful(); $response->assertSuccessful();
$response->assertHeader('X-Foo', 'Bar'); $response->assertHeader('X-Foo', 'Bar');
TenantAssetController::$headers = []; // reset static property
}); });
test('global asset helper returns the same url regardless of tenancy initialization', function () { test('global asset helper returns the same url regardless of tenancy initialization', function () {