mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:34:04 +00:00
Add more tests
This commit is contained in:
parent
f9f71ec49f
commit
1ec7807fbf
1 changed files with 27 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ class TenantManagerTest extends TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function findWorks()
|
public function find_works()
|
||||||
{
|
{
|
||||||
tenant()->create('dev.localhost');
|
tenant()->create('dev.localhost');
|
||||||
tenancy()->init('dev.localhost');
|
tenancy()->init('dev.localhost');
|
||||||
|
|
@ -60,10 +60,35 @@ class TenantManagerTest extends TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @test */
|
/** @test */
|
||||||
public function getTenantByIdWorks()
|
public function getTenantById_works()
|
||||||
{
|
{
|
||||||
$tenant = tenant()->create('foo.localhost');
|
$tenant = tenant()->create('foo.localhost');
|
||||||
|
|
||||||
$this->assertSame($tenant, tenancy()->getTenantById($tenant['uuid']));
|
$this->assertSame($tenant, tenancy()->getTenantById($tenant['uuid']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function init_returns_the_tenant()
|
||||||
|
{
|
||||||
|
$tenant = tenant()->create('foo.localhost');
|
||||||
|
|
||||||
|
$this->assertSame($tenant, tenancy()->init('foo.localhost'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function initById_returns_the_tenant()
|
||||||
|
{
|
||||||
|
$tenant = tenant()->create('foo.localhost');
|
||||||
|
$uuid = $tenant['uuid'];
|
||||||
|
|
||||||
|
$this->assertSame($tenant, tenancy()->initById($uuid));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @test */
|
||||||
|
public function create_returns_the_supplied_domain()
|
||||||
|
{
|
||||||
|
$domain = 'foo.localhost';
|
||||||
|
|
||||||
|
$this->assertSame($domain, tenant()->create($domain)['domain']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue