From 675193dd09fe41716016dcd479c3cda20fb0da33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 3 Aug 2025 23:17:57 +0200 Subject: [PATCH] static property reset --- tests/CachedTenantResolverTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/CachedTenantResolverTest.php b/tests/CachedTenantResolverTest.php index 2745c112..322a1961 100644 --- a/tests/CachedTenantResolverTest.php +++ b/tests/CachedTenantResolverTest.php @@ -17,6 +17,12 @@ use Stancl\Tenancy\Middleware\InitializeTenancyByPath; use Stancl\Tenancy\Resolvers\RequestDataTenantResolver; use function Stancl\Tenancy\Tests\pest; +beforeEach($cleanup = function () { + Tenant::$extraCustomColumns = []; +}); + +afterEach($cleanup); + test('tenants can be resolved using cached resolvers', function (string $resolver, bool $configureTenantModelColumn) { $tenant = Tenant::create([$tenantModelColumn = tenantModelColumn($configureTenantModelColumn) => 'acme']); @@ -320,8 +326,6 @@ test('PathTenantResolver properly separates cache for each tenant column', funct pest()->get("/x/bar/b")->assertSee('foo'); expect(count(DB::getRawQueryLog()))->toBe(4); // unchanged expect(count($redisKeys()))->toBe(4); // unchanged - - Tenant::$extraCustomColumns = []; // reset }); /**