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

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.
This commit is contained in:
lukinovec 2026-08-18 14:21:05 +02:00 committed by Samuel Stancl
parent 1fb9acec75
commit c1e09fb25d

View file

@ -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' => [