1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 09:34:03 +00:00

Grab the central connection name from the config in harden test

Other tests grab the central connection from the config instead of hardcoding 'central'. Doing the same in 'harden prevents tenants from using the database of another tenant' for consistency.
This commit is contained in:
lukinovec 2026-06-30 06:22:48 +02:00
parent c784a26cee
commit e75ac38751

View file

@ -115,7 +115,7 @@ test('harden prevents tenants from using the database of another tenant', functi
expect(fn () => tenancy()->initialize($tenant))->toThrow(RuntimeException::class); expect(fn () => tenancy()->initialize($tenant))->toThrow(RuntimeException::class);
// Connection should be reverted back to central // Connection should be reverted back to central
expect(DB::connection()->getName())->toBe('central'); expect(DB::connection()->getName())->toBe(config('tenancy.database.central_connection'));
} else { } else {
expect(fn() => tenancy()->initialize($tenant))->not()->toThrow(Throwable::class); expect(fn() => tenancy()->initialize($tenant))->not()->toThrow(Throwable::class);