mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 12:54:05 +00:00
wip
This commit is contained in:
parent
01c9671461
commit
a99f5d916d
1 changed files with 6 additions and 3 deletions
|
|
@ -8,6 +8,9 @@ use Stancl\Tenancy\Tenant;
|
|||
|
||||
class CachedResolverTest extends TestCase
|
||||
{
|
||||
public $autoCreateTenant = false;
|
||||
public $autoInitTenancy = false;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
|
@ -20,7 +23,7 @@ class CachedResolverTest extends TestCase
|
|||
/** @test */
|
||||
public function a_query_is_not_made_for_tenant_id_once_domain_is_cached()
|
||||
{
|
||||
$tenant = Tenant::new()->withDomains(['foo.localhost']);
|
||||
$tenant = Tenant::new()->withDomains(['foo.localhost'])->save();
|
||||
|
||||
// todo assert query is made:
|
||||
$queried = tenancy()->findByDomain('foo.localhost');
|
||||
|
|
@ -32,7 +35,7 @@ class CachedResolverTest extends TestCase
|
|||
/** @test */
|
||||
public function a_query_is_not_made_for_tenant_once_id_is_cached()
|
||||
{
|
||||
$tenant = Tenant::new()->withData(['id' => '123']);
|
||||
$tenant = Tenant::new()->withData(['id' => '123'])->save();
|
||||
|
||||
// todo assert query is made:
|
||||
$queried = tenancy()->find('123');
|
||||
|
|
@ -49,7 +52,7 @@ class CachedResolverTest extends TestCase
|
|||
/** @test */
|
||||
public function modifying_tenants_data_updates_data_in_the_cached_id_to_tenant_data_mapping()
|
||||
{
|
||||
$tenant = Tenant::new()->withData(['id' => '123', 'foo' => 'bar']);
|
||||
$tenant = Tenant::new()->withData(['id' => '123', 'foo' => 'bar'])->save();
|
||||
|
||||
// todo assert cache record is set
|
||||
$this->assertSame('bar', tenancy()->find('123')->get('foo'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue