From 2f9130999083e3379391ba01489ffeb9a7d4cbf8 Mon Sep 17 00:00:00 2001 From: Abrar Ahmad Date: Thu, 1 Dec 2022 14:59:13 +0500 Subject: [PATCH] introduce second tenant in test --- tests/PrefixCacheBootstrapperTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/PrefixCacheBootstrapperTest.php b/tests/PrefixCacheBootstrapperTest.php index 4c0c7528..3c342f36 100644 --- a/tests/PrefixCacheBootstrapperTest.php +++ b/tests/PrefixCacheBootstrapperTest.php @@ -128,12 +128,19 @@ test('prefix separate cache well enough using CacheManager dependency injection' expect(cache('key'))->toBe('central-value'); - $tenant = Tenant::create(); - tenancy()->initialize($tenant); + $tenant1 = Tenant::create(); + $tenant2 = Tenant::create(); + tenancy()->initialize($tenant1); expect(cache('key'))->toBeNull(); app()->make(CacheAction::class)->handle(); - expect(cache('key'))->toBe($tenant->getTenantKey()); + expect(cache('key'))->toBe($tenant1->getTenantKey()); + + tenancy()->initialize($tenant2); + + expect(cache('key'))->toBeNull(); + app()->make(CacheAction::class)->handle(); + expect(cache('key'))->toBe($tenant2->getTenantKey()); tenancy()->end();