1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 14:34:04 +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 */
public function tags_separate_cache_well_enough()
{
tenant()->create('foo.localhost');
tenancy()->init('foo.localhost');
cache()->put('foo', 'bar', 1);
$this->assertSame('bar', cache()->get('foo'));
tenant()->create('foo.localhost');
tenancy()->init();
tenant()->create('bar.localhost');
tenancy()->init('bar.localhost');
$this->assertNotSame('bar', cache()->get('foo'));
@ -58,12 +60,14 @@ class CacheManagerTest extends TestCase
/** @test */
public function invoking_the_cache_helper_works()
{
tenant()->create('foo.localhost');
tenancy()->init('foo.localhost');
cache(['foo' => 'bar'], 1);
$this->assertSame('bar', cache('foo'));
tenant()->create('foo.localhost');
tenancy()->init();
tenant()->create('bar.localhost');
tenancy()->init('bar.localhost');
$this->assertNotSame('bar', cache('foo'));