From c1e09fb25d82720834f02ffe84e5d84f3fb29d03 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 18 Aug 2026 14:21:05 +0200 Subject: [PATCH] Assert that DeleteTenantStorage does not delete the central storage directory when the FS bootstrapper is disabled With the bootstrapper disabled, the job resolves the path to a tenant directory that was never created, so nothing gets deleted. --- .../FilesystemTenancyBootstrapperTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Bootstrappers/FilesystemTenancyBootstrapperTest.php b/tests/Bootstrappers/FilesystemTenancyBootstrapperTest.php index add296fd..1135e84d 100644 --- a/tests/Bootstrappers/FilesystemTenancyBootstrapperTest.php +++ b/tests/Bootstrappers/FilesystemTenancyBootstrapperTest.php @@ -218,6 +218,17 @@ test('tenant storage gets deleted during tenant deletion when the DeletingTenant expect(File::isDirectory($centralStoragePath))->toBeTrue(); })->with([true, false]); +test('DeleteTenantStorage does not delete the central storage directory when the filesystem bootstrapper is disabled', function () { + config(['tenancy.bootstrappers' => []]); + + $centralStoragePath = storage_path(); + $tenant = Tenant::create(); + + (new DeleteTenantStorage($tenant))->handle(); + + expect(File::isDirectory($centralStoragePath))->toBeTrue(); +}); + test('the framework/cache directory is created when storage_path is scoped', function (bool $suffixStoragePath) { config([ 'tenancy.bootstrappers' => [