From 9bfc9c4dca358b7df79caa76d5c5369716491a94 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 8 Sep 2026 18:27:38 +0200 Subject: [PATCH] Delete the 'tenant assets are served from the central storage path in central context' test On one hand, this test covered the TenantAssetController's fallback. On the other hand, using tenant asset routes in central context is not a valid use case (also, the fallback isn't exactly a new thing) --- tests/TenantAssetTest.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/TenantAssetTest.php b/tests/TenantAssetTest.php index b74b4a90..603db9b3 100644 --- a/tests/TenantAssetTest.php +++ b/tests/TenantAssetTest.php @@ -31,7 +31,6 @@ beforeEach(function () { TenancyUrlGenerator::$passTenantParameterToRoutes = true; TenantAssetController::$headers = []; TenantAssetController::$publicDisk = null; - InitializeTenancyByRequestData::$onFail = null; /** @var CloneRoutesAsTenant $cloneAction */ $cloneAction = app(CloneRoutesAsTenant::class); @@ -44,7 +43,6 @@ beforeEach(function () { 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 () { @@ -222,21 +220,6 @@ test('tenant assets are served from the resolved root of the configured disk', f } }); -test('tenant assets are served from the central storage path in central context', function () { - config(['tenancy.identification.default_middleware' => InitializeTenancyByRequestData::class]); - - // Mimic the universal route setup (let the request through even though no tenant is identified) - InitializeTenancyByRequestData::$onFail = fn ($e, $request, $next) => $next($request); - - $filename = 'testfile' . Str::random(8); - Storage::disk('public')->put($filename, 'bar'); - - $response = pest()->get(tenant_asset($filename)); - - $response->assertSuccessful(); - expect($response->getFile()->getPathname())->toBe(storage_path("app/public/$filename")); -}); - test('asset helper returns a link to tenant asset controller when asset url is null', function () { config(['app.asset_url' => null]); config(['tenancy.filesystem.asset_helper_override' => true]);