mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 19:24:02 +00:00
wip
This commit is contained in:
parent
7a96ff1e66
commit
928df4a487
1 changed files with 23 additions and 7 deletions
|
|
@ -12,16 +12,32 @@ class GlobalCacheTest extends TestCase
|
|||
/** @test */
|
||||
public function global_cache_manager_stores_data_in_global_cache()
|
||||
{
|
||||
dd(app('globalCache'));
|
||||
dd(cache());
|
||||
$this->assertSame(null, cache('foo'));
|
||||
cache(['foo' => 'bar'], 1);
|
||||
$this->assertSame('bar', cache('foo'));
|
||||
// $this->assertSame('bar', GlobalCache::get('foo'));
|
||||
// GlobalCache::put('foo', 'bar');
|
||||
dd(GlobalCache::get('foo'));
|
||||
GlobalCache::put(['foo' => 'bar'], 1);
|
||||
$this->assertSame('bar', GlobalCache::get('foo'));
|
||||
|
||||
tenant()->create('foo.localhost');
|
||||
tenancy()->init('foo.localhost');
|
||||
$this->assertSame('bar', GlobalCache::get('foo'));
|
||||
|
||||
GlobalCache::put(['abc' => 'xyz'], 1);
|
||||
cache(['def' => 'ghi'], 1);
|
||||
$this->assertSame('ghi', cache('def'));
|
||||
|
||||
tenancy()->end();
|
||||
$this->assertSame('xyz', GlobalCache::get('abc'));
|
||||
$this->assertSame('bar', GlobalCache::get('foo'));
|
||||
$this->assertSame(null, cache('def'));
|
||||
|
||||
tenant()->create('bar.localhost');
|
||||
tenancy()->init('bar.localhost');
|
||||
$this->assertSame('xyz', GlobalCache::get('abc'));
|
||||
$this->assertSame('bar', GlobalCache::get('foo'));
|
||||
$this->assertSame(null, cache('def'));
|
||||
cache(['def' => 'xxx'], 1);
|
||||
$this->assertSame('xxx', cache('def'));
|
||||
|
||||
tenancy()->init('foo.localhost');
|
||||
$this->assertSame('ghi', cache('def'));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue