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

Fix some tests

This commit is contained in:
Samuel Štancl 2019-09-16 16:57:55 +02:00
parent a632b545b7
commit 1532ccf019
15 changed files with 121 additions and 118 deletions

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Tests;
use GlobalCache;
use Stancl\Tenancy\Tenant;
class GlobalCacheTest extends TestCase
{
@ -18,7 +19,7 @@ class GlobalCacheTest extends TestCase
GlobalCache::put(['foo' => 'bar'], 1);
$this->assertSame('bar', GlobalCache::get('foo'));
tenant()->create('foo.localhost');
Tenant::new()->withDomains(['foo.localhost'])->save();
tenancy()->init('foo.localhost');
$this->assertSame('bar', GlobalCache::get('foo'));
@ -26,12 +27,12 @@ class GlobalCacheTest extends TestCase
cache(['def' => 'ghi'], 10);
$this->assertSame('ghi', cache('def'));
tenancy()->end();
tenancy()->endTenancy();
$this->assertSame('xyz', GlobalCache::get('abc'));
$this->assertSame('bar', GlobalCache::get('foo'));
$this->assertSame(null, cache('def'));
tenant()->create('bar.localhost');
Tenant::new()->withDomains(['bar.localhost'])->save();
tenancy()->init('bar.localhost');
$this->assertSame('xyz', GlobalCache::get('abc'));
$this->assertSame('bar', GlobalCache::get('foo'));