From e75ac3875170481bd2f76cd95cbbfaa19f00129a Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 30 Jun 2026 06:22:48 +0200 Subject: [PATCH] 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. --- tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php b/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php index c970accc..44229069 100644 --- a/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php +++ b/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php @@ -115,7 +115,7 @@ 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('central'); + expect(DB::connection()->getName())->toBe(config('tenancy.database.central_connection')); } else { expect(fn() => tenancy()->initialize($tenant))->not()->toThrow(Throwable::class);