mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-07 10:54:03 +00:00
Correct storage deletion test
This commit is contained in:
parent
dc659ed67a
commit
a28593af17
1 changed files with 4 additions and 4 deletions
|
|
@ -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() {
|
test('tenant storage can get deleted after the tenant when DeletingTenant listens to DeleteTenantStorage', function() {
|
||||||
|
config([
|
||||||
|
'tenancy.bootstrappers' => [FilesystemTenancyBootstrapper::class],
|
||||||
|
]);
|
||||||
|
|
||||||
Event::listen(DeletingTenant::class,
|
Event::listen(DeletingTenant::class,
|
||||||
JobPipeline::make([DeleteTenantStorage::class])->send(function (DeletingTenant $event) {
|
JobPipeline::make([DeleteTenantStorage::class])->send(function (DeletingTenant $event) {
|
||||||
return $event->tenant;
|
return $event->tenant;
|
||||||
|
|
@ -215,12 +219,8 @@ test('tenant storage can get deleted after the tenant when DeletingTenant listen
|
||||||
tenancy()->initialize(Tenant::create());
|
tenancy()->initialize(Tenant::create());
|
||||||
$tenantStoragePath = storage_path();
|
$tenantStoragePath = storage_path();
|
||||||
|
|
||||||
Storage::fake('test');
|
|
||||||
|
|
||||||
expect(File::isDirectory($tenantStoragePath))->toBeTrue();
|
expect(File::isDirectory($tenantStoragePath))->toBeTrue();
|
||||||
|
|
||||||
Storage::put('test.txt', 'testing file');
|
|
||||||
|
|
||||||
tenant()->delete();
|
tenant()->delete();
|
||||||
|
|
||||||
expect(File::isDirectory($tenantStoragePath))->toBeFalse();
|
expect(File::isDirectory($tenantStoragePath))->toBeFalse();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue