mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:44:04 +00:00
Stop testing storage directory existence in symlink test
This commit is contained in:
parent
a08b0533a8
commit
c7db232f0c
1 changed files with 6 additions and 8 deletions
|
|
@ -3,7 +3,6 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Stancl\Tenancy\Events\TenancyEnded;
|
use Stancl\Tenancy\Events\TenancyEnded;
|
||||||
use Stancl\Tenancy\Events\TenancyInitialized;
|
use Stancl\Tenancy\Events\TenancyInitialized;
|
||||||
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||||
|
|
@ -33,15 +32,12 @@ test('create storage symlinks action works', function() {
|
||||||
|
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
Storage::disk('public')->put('test.txt', 'test');
|
$this->assertDirectoryDoesNotExist($publicPath = public_path("public-$tenantKey"));
|
||||||
|
|
||||||
$this->assertDirectoryDoesNotExist(public_path("public-$tenantKey"));
|
|
||||||
|
|
||||||
CreateStorageSymlinksAction::handle($tenant);
|
CreateStorageSymlinksAction::handle($tenant);
|
||||||
|
|
||||||
$this->assertDirectoryExists(storage_path("app/public"));
|
$this->assertDirectoryExists($publicPath);
|
||||||
$this->assertDirectoryExists(public_path("public-$tenantKey"));
|
$this->assertEquals(storage_path("app/public/"), readlink($publicPath));
|
||||||
$this->assertEquals(storage_path("app/public/"), readlink(public_path("public-$tenantKey")));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('remove storage symlinks action works', function() {
|
test('remove storage symlinks action works', function() {
|
||||||
|
|
@ -62,7 +58,9 @@ test('remove storage symlinks action works', function() {
|
||||||
|
|
||||||
CreateStorageSymlinksAction::handle($tenant);
|
CreateStorageSymlinksAction::handle($tenant);
|
||||||
|
|
||||||
|
$this->assertDirectoryExists($publicPath = public_path("public-$tenantKey"));
|
||||||
|
|
||||||
RemoveStorageSymlinksAction::handle($tenant);
|
RemoveStorageSymlinksAction::handle($tenant);
|
||||||
|
|
||||||
$this->assertDirectoryDoesNotExist(public_path("public-$tenantKey"));
|
$this->assertDirectoryDoesNotExist($publicPath);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue