mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 09:34:03 +00:00
Use $centralConnection variable in both hardening tests for consistency
Decided to go with the variable assignment instead of inlining the config(...) call in the assertion since it's a bit more readable imo
This commit is contained in:
parent
184348924f
commit
59ab773aa8
1 changed files with 3 additions and 1 deletions
|
|
@ -115,7 +115,9 @@ test('harden prevents tenants from using the database of another tenant', functi
|
|||
expect(fn () => tenancy()->initialize($tenant))->toThrow(RuntimeException::class);
|
||||
|
||||
// Connection should be reverted back to central
|
||||
expect(DB::connection()->getName())->toBe(config('tenancy.database.central_connection'));
|
||||
$centralConnection = config('tenancy.database.central_connection');
|
||||
|
||||
expect(DB::connection()->getName())->toBe($centralConnection);
|
||||
} else {
|
||||
expect(fn() => tenancy()->initialize($tenant))->not()->toThrow(Throwable::class);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue