mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 04:24:03 +00:00
CacheService class as singleton
This commit is contained in:
parent
222686ec1d
commit
6c955acd13
2 changed files with 3 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ class PrefixCacheTenancyBootstrapper implements TenancyBootstrapper
|
||||||
{
|
{
|
||||||
$this->config->set('cache.prefix', $prefix);
|
$this->config->set('cache.prefix', $prefix);
|
||||||
|
|
||||||
// $this->app['cache']->forgetDriver($this->storeName);
|
$this->app['cache']->forgetDriver($this->storeName);
|
||||||
|
|
||||||
// The CacheManager will have the $app['config'] array cached with old prefixes on the 'cache' instance
|
// The CacheManager will have the $app['config'] array cached with old prefixes on the 'cache' instance
|
||||||
// This call will forget the 'cache' instance
|
// This call will forget the 'cache' instance
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,8 @@ test('cache base prefix is customizable', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('prefix separate cache well enough using CacheManager dependency injection', function () {
|
test('prefix separate cache well enough using CacheManager dependency injection', function () {
|
||||||
|
$this->app->singleton(CacheAction::class);
|
||||||
|
|
||||||
app()->make(CacheAction::class)->handle();
|
app()->make(CacheAction::class)->handle();
|
||||||
|
|
||||||
expect(cache('key'))->toBe('central-value');
|
expect(cache('key'))->toBe('central-value');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue