1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 06: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:
lukinovec 2026-06-30 07:12:12 +02:00
parent 184348924f
commit 59ab773aa8

View file

@ -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);