1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 13:14:05 +00:00

Add more tests, fix bugs

This commit is contained in:
Samuel Štancl 2019-02-08 17:54:53 +01:00
parent d14aa0b642
commit 3f650d887d
4 changed files with 65 additions and 8 deletions

View file

@ -34,10 +34,21 @@ class BootstrapsTenancyTest extends TestCase
public function filesystem_is_suffixed()
{
$old_storage_path = storage_path();
$this->initTenancy();
$new_storage_path = storage_path();
$old_storage_facade_roots = [];
foreach (config('tenancy.filesystem.disks') as $disk) {
$old_storage_facade_roots[$disk] = config("filesystems.disks.{$disk}.root");
}
$this->initTenancy();
$new_storage_path = storage_path();
$this->assertEquals($old_storage_path . "/" . config('tenancy.filesystem.suffix_base') . tenant('uuid'), $new_storage_path);
foreach (config('tenancy.filesystem.disks') as $disk) {
$suffix = config('tenancy.filesystem.suffix_base') . tenant('uuid');
$current_path_prefix = \Storage::disk($disk)->getAdapter()->getPathPrefix();
$this->assertSame($old_storage_facade_roots[$disk] . "/$suffix/", $current_path_prefix);
}
}
/** @test */