mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 15:34:03 +00:00
Assert that disks with an empty url_override are skipped by both the FS bootstrapper and possibleTenantSymlinks (regression test)
Update the existing "create storage symlinks action skips disks with a null url_override" test so that it covers disks with NO url_override (unset/null and empty string). The test fails with the empty string override at the moment.
This commit is contained in:
parent
223b49a395
commit
6b27bc5f36
1 changed files with 12 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ test('create storage symlinks action fails for disks that are not tenant-aware',
|
||||||
expect(is_link(public_path('public-' . $tenant->getTenantKey())))->toBeFalse();
|
expect(is_link(public_path('public-' . $tenant->getTenantKey())))->toBeFalse();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('create storage symlinks action skips disks with a null url_override', function () {
|
test('create storage symlinks action skips disks with no url_override', function (string|null $localUrlOverride) {
|
||||||
config([
|
config([
|
||||||
'tenancy.bootstrappers' => [
|
'tenancy.bootstrappers' => [
|
||||||
FilesystemTenancyBootstrapper::class,
|
FilesystemTenancyBootstrapper::class,
|
||||||
|
|
@ -87,8 +87,7 @@ test('create storage symlinks action skips disks with a null url_override', func
|
||||||
'tenancy.filesystem.suffix_base' => 'tenant-',
|
'tenancy.filesystem.suffix_base' => 'tenant-',
|
||||||
'tenancy.filesystem.url_override' => [
|
'tenancy.filesystem.url_override' => [
|
||||||
'public' => 'public-%tenant%',
|
'public' => 'public-%tenant%',
|
||||||
// A null override means the disk's URL is not overridden, same as in the FS bootstrapper
|
'local' => $localUrlOverride,
|
||||||
'local' => null,
|
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -99,7 +98,16 @@ test('create storage symlinks action skips disks with a null url_override', func
|
||||||
|
|
||||||
// The local disk is skipped, so the public disk still gets its symlink
|
// The local disk is skipped, so the public disk still gets its symlink
|
||||||
expect(is_link(public_path('public-' . $tenant->getTenantKey())))->toBeTrue();
|
expect(is_link(public_path('public-' . $tenant->getTenantKey())))->toBeTrue();
|
||||||
});
|
|
||||||
|
// The bootstrapper skips the same disk, so its URL is not overridden either
|
||||||
|
$centralUrl = config('filesystems.disks.local.url');
|
||||||
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
|
expect(config('filesystems.disks.local.url'))->toBe($centralUrl);
|
||||||
|
})->with([
|
||||||
|
'null url_override' => [null],
|
||||||
|
'empty url_override' => [''],
|
||||||
|
]);
|
||||||
|
|
||||||
test('remove storage symlinks action works', function() {
|
test('remove storage symlinks action works', function() {
|
||||||
config([
|
config([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue