mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
* fix #1112 - throw an exception when DATABASE_URL is defined, minor test changes * Fix code style (php-cs-fixer) * fix typo --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
This commit is contained in:
parent
af3812e788
commit
2d500f9780
5 changed files with 33 additions and 1 deletions
|
|
@ -631,6 +631,24 @@ test('fortify route tenancy bootstrapper updates fortify config correctly', func
|
|||
expect(config('fortify.redirects'))->toBe($originalFortifyRedirects);
|
||||
});
|
||||
|
||||
test('database tenancy bootstrapper throws an exception if DATABASE_URL is set', function (string|null $databaseUrl) {
|
||||
if ($databaseUrl) {
|
||||
config(['database.connections.central.url' => $databaseUrl]);
|
||||
|
||||
pest()->expectException(Exception::class);
|
||||
}
|
||||
|
||||
config(['tenancy.bootstrappers' => [DatabaseTenancyBootstrapper::class]]);
|
||||
|
||||
$tenant1 = Tenant::create();
|
||||
|
||||
pest()->artisan('tenants:migrate');
|
||||
|
||||
tenancy()->initialize($tenant1);
|
||||
|
||||
expect(true)->toBe(true);
|
||||
})->with(['abc.us-east-1.rds.amazonaws.com', null]);
|
||||
|
||||
function getDiskPrefix(string $disk): string
|
||||
{
|
||||
/** @var FilesystemAdapter $disk */
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ test('tenancy is initialized when retrying jobs', function (bool $shouldEndTenan
|
|||
});
|
||||
})->with([true, false]);
|
||||
|
||||
// todo0 this test appears to be affected by race conditions/similar
|
||||
test('the tenant used by the job doesnt change when the current tenant changes', function () {
|
||||
withTenantDatabases();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue