1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 02:04:03 +00:00

Set cache.default in beforeEach

This commit is contained in:
lukinovec 2023-04-17 12:36:59 +02:00
parent 0c1912b9c5
commit 13b85a2d3b

View file

@ -42,7 +42,8 @@ use Stancl\Tenancy\CacheManager;
beforeEach(function () { beforeEach(function () {
$this->mockConsoleOutput = false; $this->mockConsoleOutput = false;
CacheManager::$addTags = false; CacheManager::$addTags = false;
PrefixCacheTenancyBootstrapper::$tenantCacheStores = ['redis']; config(['cache.default' => $cacheDriver = 'redis']);
PrefixCacheTenancyBootstrapper::$tenantCacheStores = [$cacheDriver];
Event::listen( Event::listen(
TenantCreated::class, TenantCreated::class,
@ -92,9 +93,10 @@ test('database data is separated', function () {
}); });
test('cache data is separated', function (string $bootstrapper) { test('cache data is separated', function (string $bootstrapper) {
expect(config('cache.default'))->toBe('redis');
config([ config([
'tenancy.bootstrappers' => [$bootstrapper], 'tenancy.bootstrappers' => [$bootstrapper],
'cache.default' => 'redis',
]); ]);
$tenant1 = Tenant::create(); $tenant1 = Tenant::create();