mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 08:04:03 +00:00
phpstan, global_cache, resolver improvements, InitializationHelpers trait
This commit is contained in:
parent
fd65cf1754
commit
87212e5390
35 changed files with 170 additions and 231 deletions
|
|
@ -50,3 +50,17 @@ test('global cache manager stores data in global cache', function () {
|
|||
expect(cache('def'))->toBe('ghi');
|
||||
});
|
||||
|
||||
test('the global_cache helper supports the same syntax as the cache helper', function () {
|
||||
$tenant = Tenant::create();
|
||||
$tenant->enter();
|
||||
|
||||
expect(cache('foo'))->toBe(null); // tenant cache is empty
|
||||
|
||||
global_cache(['foo' => 'bar']);
|
||||
expect(global_cache('foo'))->toBe('bar');
|
||||
|
||||
global_cache()->set('foo', 'baz');
|
||||
expect(global_cache()->get('foo'))->toBe('baz');
|
||||
|
||||
expect(cache('foo'))->toBe(null); // tenant cache is not affected
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue