mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:44:04 +00:00
introduce second tenant in test
This commit is contained in:
parent
6c955acd13
commit
2f91309990
1 changed files with 10 additions and 3 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue