1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00

Stop testing storage directory existence in symlink test

This commit is contained in:
lukinovec 2022-08-31 09:24:51 +02:00
parent a08b0533a8
commit c7db232f0c

View file

@ -3,7 +3,6 @@
declare(strict_types=1);
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Storage;
use Stancl\Tenancy\Events\TenancyEnded;
use Stancl\Tenancy\Events\TenancyInitialized;
use Stancl\Tenancy\Listeners\BootstrapTenancy;
@ -33,15 +32,12 @@ test('create storage symlinks action works', function() {
tenancy()->initialize($tenant);
Storage::disk('public')->put('test.txt', 'test');
$this->assertDirectoryDoesNotExist(public_path("public-$tenantKey"));
$this->assertDirectoryDoesNotExist($publicPath = public_path("public-$tenantKey"));
CreateStorageSymlinksAction::handle($tenant);
$this->assertDirectoryExists(storage_path("app/public"));
$this->assertDirectoryExists(public_path("public-$tenantKey"));
$this->assertEquals(storage_path("app/public/"), readlink(public_path("public-$tenantKey")));
$this->assertDirectoryExists($publicPath);
$this->assertEquals(storage_path("app/public/"), readlink($publicPath));
});
test('remove storage symlinks action works', function() {
@ -62,7 +58,9 @@ test('remove storage symlinks action works', function() {
CreateStorageSymlinksAction::handle($tenant);
$this->assertDirectoryExists($publicPath = public_path("public-$tenantKey"));
RemoveStorageSymlinksAction::handle($tenant);
$this->assertDirectoryDoesNotExist(public_path("public-$tenantKey"));
$this->assertDirectoryDoesNotExist($publicPath);
});