mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 20:54:04 +00:00
Rename CacheAction to CacheService
This commit is contained in:
parent
974414a12d
commit
4c33df1aa5
2 changed files with 6 additions and 6 deletions
|
|
@ -6,7 +6,7 @@ namespace Stancl\Tenancy\Tests\Etc;
|
|||
|
||||
use Illuminate\Cache\Repository;
|
||||
|
||||
class CacheAction // todo renamed to CacheService
|
||||
class CacheService
|
||||
{
|
||||
public function __construct(
|
||||
protected Repository $cache
|
||||
|
|
@ -8,7 +8,7 @@ use Stancl\Tenancy\Events\TenancyEnded;
|
|||
use Stancl\Tenancy\Events\TenancyInitialized;
|
||||
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
||||
use Stancl\Tenancy\Tests\Etc\CacheAction;
|
||||
use Stancl\Tenancy\Tests\Etc\CacheService;
|
||||
|
||||
beforeEach(function () {
|
||||
config([
|
||||
|
|
@ -124,9 +124,9 @@ test('cache base prefix is customizable', function () {
|
|||
});
|
||||
|
||||
test('prefix separate cache well enough using CacheManager dependency injection', function () {
|
||||
$this->app->singleton(CacheAction::class);
|
||||
$this->app->singleton(CacheService::class);
|
||||
|
||||
app()->make(CacheAction::class)->handle();
|
||||
app()->make(CacheService::class)->handle();
|
||||
|
||||
expect(cache('key'))->toBe('central-value');
|
||||
|
||||
|
|
@ -135,13 +135,13 @@ test('prefix separate cache well enough using CacheManager dependency injection'
|
|||
tenancy()->initialize($tenant1);
|
||||
|
||||
expect(cache('key'))->toBeNull();
|
||||
app()->make(CacheAction::class)->handle();
|
||||
app()->make(CacheService::class)->handle();
|
||||
expect(cache('key'))->toBe($tenant1->getTenantKey());
|
||||
|
||||
tenancy()->initialize($tenant2);
|
||||
|
||||
expect(cache('key'))->toBeNull();
|
||||
app()->make(CacheAction::class)->handle();
|
||||
app()->make(CacheService::class)->handle();
|
||||
expect(cache('key'))->toBe($tenant2->getTenantKey());
|
||||
|
||||
tenancy()->end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue