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

TenantDatabaseManagerTest fully passes now

This commit is contained in:
Samuel Štancl 2019-09-17 18:57:19 +02:00
parent 5e9b421aa6
commit 524530c8d5
8 changed files with 28 additions and 24 deletions

View file

@ -49,14 +49,14 @@ class TenantManagerTest extends TestCase
{
$tenant = Tenant::new()->withDomains(['foo.localhost'])->save();
$this->assertSame($tenant, tenant()->findByDomain('foo.localhost'));
$this->assertSame($tenant, tenancy()->findByDomain('foo.localhost'));
}
/** @test */
public function getIdByDomain_works()
{
$tenant = Tenant::new()->withDomains(['foo.localhost'])->save();
$this->assertSame(tenant()->getTenantIdByDomain('foo.localhost'), tenant()->getIdByDomain('foo.localhost'));
$this->assertSame(tenant()->getTenantIdByDomain('foo.localhost'), tenancy()->getIdByDomain('foo.localhost'));
}
/** @test */
@ -65,7 +65,7 @@ class TenantManagerTest extends TestCase
Tenant::new()->withDomains(['dev.localhost'])->save();
tenancy()->init('dev.localhost');
$this->assertSame(tenant()->tenant, tenant()->find(tenant('id')));
$this->assertSame(tenant(), tenancy()->find(tenant('id')));
}
/** @test */
@ -76,14 +76,6 @@ class TenantManagerTest extends TestCase
$this->assertSame($tenant, tenancy()->getTenantById($tenant['id']));
}
/** @test */
public function create_returns_the_supplied_domain()
{
$domain = 'foo.localhost';
$this->assertSame($domain, Tenant::new()->withDomains([$domain])->save()['domain']);
}
/** @test */
public function findByDomain_throws_an_exception_when_an_unused_domain_is_supplied()
{