mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-20 22:54:05 +00:00
Clean up $adjustCacheManagerUsing in before and afterEach
This commit is contained in:
parent
fd1aa2439a
commit
20036ef1ff
2 changed files with 9 additions and 0 deletions
|
|
@ -24,12 +24,14 @@ use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||||
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
||||||
use Stancl\Tenancy\Middleware\InitializeTenancyByPath;
|
use Stancl\Tenancy\Middleware\InitializeTenancyByPath;
|
||||||
use Stancl\Tenancy\Resolvers\RequestDataTenantResolver;
|
use Stancl\Tenancy\Resolvers\RequestDataTenantResolver;
|
||||||
|
use Stancl\Tenancy\TenancyServiceProvider;
|
||||||
use function Stancl\Tenancy\Tests\pest;
|
use function Stancl\Tenancy\Tests\pest;
|
||||||
use function Stancl\Tenancy\Tests\withCacheTables;
|
use function Stancl\Tenancy\Tests\withCacheTables;
|
||||||
use function Stancl\Tenancy\Tests\withTenantDatabases;
|
use function Stancl\Tenancy\Tests\withTenantDatabases;
|
||||||
|
|
||||||
beforeEach($cleanup = function () {
|
beforeEach($cleanup = function () {
|
||||||
Tenant::$extraCustomColumns = [];
|
Tenant::$extraCustomColumns = [];
|
||||||
|
TenancyServiceProvider::$adjustCacheManagerUsing = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach($cleanup);
|
afterEach($cleanup);
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,14 @@ use Stancl\Tenancy\Bootstrappers\CacheTagsBootstrapper;
|
||||||
use Stancl\Tenancy\Bootstrappers\CacheTenancyBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\CacheTenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Bootstrappers\DatabaseCacheBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\DatabaseCacheBootstrapper;
|
||||||
use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\DatabaseTenancyBootstrapper;
|
||||||
|
use Stancl\Tenancy\TenancyServiceProvider;
|
||||||
|
|
||||||
use function Stancl\Tenancy\Tests\withCacheTables;
|
use function Stancl\Tenancy\Tests\withCacheTables;
|
||||||
use function Stancl\Tenancy\Tests\withTenantDatabases;
|
use function Stancl\Tenancy\Tests\withTenantDatabases;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
TenancyServiceProvider::$adjustCacheManagerUsing = null;
|
||||||
|
|
||||||
config([
|
config([
|
||||||
'cache.default' => 'redis',
|
'cache.default' => 'redis',
|
||||||
'tenancy.cache.stores' => ['redis'],
|
'tenancy.cache.stores' => ['redis'],
|
||||||
|
|
@ -29,6 +32,10 @@ beforeEach(function () {
|
||||||
withCacheTables();
|
withCacheTables();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
TenancyServiceProvider::$adjustCacheManagerUsing = null;
|
||||||
|
});
|
||||||
|
|
||||||
test('global cache manager stores data in global cache', function (string $store, array $bootstrappers) {
|
test('global cache manager stores data in global cache', function (string $store, array $bootstrappers) {
|
||||||
config([
|
config([
|
||||||
'cache.default' => $store,
|
'cache.default' => $store,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue