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

Simplify cache tests

This commit is contained in:
lukinovec 2023-04-13 13:44:00 +02:00
parent 9e15110ad9
commit dd57d9bbdc
2 changed files with 11 additions and 29 deletions

View file

@ -41,6 +41,7 @@ use Stancl\Tenancy\CacheManager;
beforeEach(function () {
$this->mockConsoleOutput = false;
CacheManager::$addTags = false;
Event::listen(
TenantCreated::class,
@ -53,6 +54,10 @@ beforeEach(function () {
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
});
afterEach(function () {
CacheManager::$addTags = false;
});
test('database data is separated', function () {
config(['tenancy.bootstrappers' => [
DatabaseTenancyBootstrapper::class,
@ -88,10 +93,7 @@ test('cache data is separated', function (string $bootstrapper) {
$cacheDriver = 'redis';
if ($bootstrapper === PrefixCacheTenancyBootstrapper::class) {
CacheManager::$addTags = false;
PrefixCacheTenancyBootstrapper::$tenantCacheStores = [$cacheDriver];
} else {
CacheManager::$addTags = true;
}
config([