From 13b85a2d3be9041d069f00f6e7306d4a9ad32290 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Mon, 17 Apr 2023 12:36:59 +0200 Subject: [PATCH] Set `cache.default` in beforeEach --- tests/BootstrapperTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/BootstrapperTest.php b/tests/BootstrapperTest.php index 901587f6..fe62a9ae 100644 --- a/tests/BootstrapperTest.php +++ b/tests/BootstrapperTest.php @@ -42,7 +42,8 @@ use Stancl\Tenancy\CacheManager; beforeEach(function () { $this->mockConsoleOutput = false; CacheManager::$addTags = false; - PrefixCacheTenancyBootstrapper::$tenantCacheStores = ['redis']; + config(['cache.default' => $cacheDriver = 'redis']); + PrefixCacheTenancyBootstrapper::$tenantCacheStores = [$cacheDriver]; Event::listen( TenantCreated::class, @@ -92,9 +93,10 @@ test('database data is separated', function () { }); test('cache data is separated', function (string $bootstrapper) { + expect(config('cache.default'))->toBe('redis'); + config([ 'tenancy.bootstrappers' => [$bootstrapper], - 'cache.default' => 'redis', ]); $tenant1 = Tenant::create();