mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 15:54:03 +00:00
Add more CacheManager tests
This commit is contained in:
parent
4b1dca41e5
commit
0c724ca2a0
1 changed files with 34 additions and 0 deletions
|
|
@ -37,4 +37,38 @@ class CacheManagerTest extends TestCase
|
|||
$this->expectException(\Exception::class);
|
||||
cache()->tags(1, 2);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function tags_separate_cache_well_enough()
|
||||
{
|
||||
cache()->put('foo', 'bar', 1);
|
||||
|
||||
$this->assertSame('bar', cache()->get('foo'));
|
||||
|
||||
tenant()->create('foo.localhost');
|
||||
tenancy()->init();
|
||||
|
||||
$this->assertNotSame('bar', cache()->get('foo'));
|
||||
|
||||
cache()->put('foo', 'xyz', 1);
|
||||
|
||||
$this->assertSame('xyz', cache()->get('foo'));
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function invoking_the_cache_helper_works()
|
||||
{
|
||||
cache(['foo' => 'bar'], 1);
|
||||
|
||||
$this->assertSame('bar', cache('foo'));
|
||||
|
||||
tenant()->create('foo.localhost');
|
||||
tenancy()->init();
|
||||
|
||||
$this->assertNotSame('bar', cache('foo'));
|
||||
|
||||
cache(['foo' => 'xyz'], 1);
|
||||
|
||||
$this->assertSame('xyz', cache('foo'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue