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:
parent
0c1912b9c5
commit
13b85a2d3b
1 changed files with 4 additions and 2 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue