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

Make tenancy()->init() statements more specific

This commit is contained in:
Samuel Štancl 2019-02-13 18:15:22 +01:00
parent 0c724ca2a0
commit 08f6db4ffe

View file

@ -41,12 +41,14 @@ class CacheManagerTest extends TestCase
/** @test */ /** @test */
public function tags_separate_cache_well_enough() public function tags_separate_cache_well_enough()
{ {
tenant()->create('foo.localhost');
tenancy()->init('foo.localhost');
cache()->put('foo', 'bar', 1); cache()->put('foo', 'bar', 1);
$this->assertSame('bar', cache()->get('foo')); $this->assertSame('bar', cache()->get('foo'));
tenant()->create('foo.localhost'); tenant()->create('bar.localhost');
tenancy()->init(); tenancy()->init('bar.localhost');
$this->assertNotSame('bar', cache()->get('foo')); $this->assertNotSame('bar', cache()->get('foo'));
@ -58,12 +60,14 @@ class CacheManagerTest extends TestCase
/** @test */ /** @test */
public function invoking_the_cache_helper_works() public function invoking_the_cache_helper_works()
{ {
tenant()->create('foo.localhost');
tenancy()->init('foo.localhost');
cache(['foo' => 'bar'], 1); cache(['foo' => 'bar'], 1);
$this->assertSame('bar', cache('foo')); $this->assertSame('bar', cache('foo'));
tenant()->create('foo.localhost'); tenant()->create('bar.localhost');
tenancy()->init(); tenancy()->init('bar.localhost');
$this->assertNotSame('bar', cache('foo')); $this->assertNotSame('bar', cache('foo'));