mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 21:54:03 +00:00
Make GlobalCache facade not cached. Even though it wasn't causing issues
in our existing tests, it likely was flaky, and making it not $cached makes it now consistent with global_cache() - always getting a new CacheManager from the globalCache container binding
This commit is contained in:
parent
3ca90bc445
commit
dbb8470b80
3 changed files with 11 additions and 2 deletions
|
|
@ -68,6 +68,14 @@ test('global cache manager stores data in global cache', function (string $boots
|
|||
CacheTenancyBootstrapper::class,
|
||||
]);
|
||||
|
||||
test('global cache facade is not persistent', function () {
|
||||
$oldId = spl_object_id(GlobalCache::getFacadeRoot());
|
||||
|
||||
$_ = new class {};
|
||||
|
||||
expect(spl_object_id(GlobalCache::getFacadeRoot()))->not()->toBe($oldId);
|
||||
});
|
||||
|
||||
test('global cache is always central', function (string $store, array $bootstrappers, string $initialCentralCall) {
|
||||
config([
|
||||
'cache.default' => $store,
|
||||
|
|
@ -130,7 +138,6 @@ test('global cache is always central', function (string $store, array $bootstrap
|
|||
expect(global_cache('central-facade'))->toBe(true);
|
||||
expect(GlobalCache::get('central-facade'))->toBe(true);
|
||||
}
|
||||
|
||||
})->with([
|
||||
['redis', [CacheTagsBootstrapper::class]],
|
||||
['redis', [CacheTenancyBootstrapper::class]],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue