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

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)
This commit is contained in:
lukinovec 2026-09-08 18:27:38 +02:00
parent 823e5c34d6
commit 9bfc9c4dca

View file

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