1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-07 02:04:04 +00:00

Correct storage deletion test

This commit is contained in:
lukinovec 2026-04-13 16:24:12 +02:00
parent dc659ed67a
commit a28593af17

View file

@ -206,6 +206,10 @@ test('tenant storage gets created when TenantCreated listens to CreateTenantStor
});
test('tenant storage can get deleted after the tenant when DeletingTenant listens to DeleteTenantStorage', function() {
config([
'tenancy.bootstrappers' => [FilesystemTenancyBootstrapper::class],
]);
Event::listen(DeletingTenant::class,
JobPipeline::make([DeleteTenantStorage::class])->send(function (DeletingTenant $event) {
return $event->tenant;
@ -215,12 +219,8 @@ test('tenant storage can get deleted after the tenant when DeletingTenant listen
tenancy()->initialize(Tenant::create());
$tenantStoragePath = storage_path();
Storage::fake('test');
expect(File::isDirectory($tenantStoragePath))->toBeTrue();
Storage::put('test.txt', 'testing file');
tenant()->delete();
expect(File::isDirectory($tenantStoragePath))->toBeFalse();