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

Save storage_path() in a variable after initializing tenant in test

Co-authored-by: Samuel Štancl <samuel.stancl@gmail.com>
This commit is contained in:
lukinovec 2022-09-09 07:50:27 +02:00 committed by GitHub
parent 21664664dd
commit 624f032775
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,16 +201,17 @@ test('tenant storage gets deleted after the tenant if filesystem.delete_storage_
});
tenancy()->initialize(Tenant::create());
$tenantStoragePath = storage_path();
Storage::fake('test');
expect(File::isDirectory(storage_path()))->toBeTrue();
expect(File::isDirectory($tenantStoragePath))->toBeTrue();
Storage::put('test.txt', 'testing file');
tenant()->delete();
expect(File::isDirectory(storage_path()))->toBeFalse();
expect(File::isDirectory($tenantStoragePath))->toBeFalse();
});
function getDiskPrefix(string $disk): string