From 59ab773aa8aed13c4c9f25de040fcc74ab3e5075 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 30 Jun 2026 07:12:12 +0200 Subject: [PATCH] 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 --- tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php b/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php index 3376a581..4debea9e 100644 --- a/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php +++ b/tests/Bootstrappers/DatabaseTenancyBootstrapperTest.php @@ -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);