From 1ec7807fbf89da2c41ff807f5e1e6566da607ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 10 Feb 2019 21:38:30 +0100 Subject: [PATCH] Add more tests --- tests/TenantManagerTest.php | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/TenantManagerTest.php b/tests/TenantManagerTest.php index b1a5fece..e292dd13 100644 --- a/tests/TenantManagerTest.php +++ b/tests/TenantManagerTest.php @@ -51,7 +51,7 @@ class TenantManagerTest extends TestCase } /** @test */ - public function findWorks() + public function find_works() { tenant()->create('dev.localhost'); tenancy()->init('dev.localhost'); @@ -60,10 +60,35 @@ class TenantManagerTest extends TestCase } /** @test */ - public function getTenantByIdWorks() + public function getTenantById_works() { $tenant = tenant()->create('foo.localhost'); $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']); + } }