diff --git a/src/Facades/TenantFacade.php b/src/Facades/TenantFacade.php index 6efddd32..86a36039 100644 --- a/src/Facades/TenantFacade.php +++ b/src/Facades/TenantFacade.php @@ -14,7 +14,7 @@ class TenantFacade extends Facade return Tenant::class; } - // todo test this + // todo2 test this public static function create($domains, array $data): Tenant { return Tenant::create($domains, $data); diff --git a/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php b/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php index fae8d144..a2071b83 100644 --- a/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/TenancyBootstrappers/FilesystemTenancyBootstrapper.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Storage; use Stancl\Tenancy\Contracts\TenancyBootstrapper; use Stancl\Tenancy\Tenant; -// todo better solution than tenant_asset? +// todo2 better solution than tenant_asset? class FilesystemTenancyBootstrapper implements TenancyBootstrapper { diff --git a/tests/FacadeTest.php b/tests/FacadeTest.php index fb7f1200..fee8351f 100644 --- a/tests/FacadeTest.php +++ b/tests/FacadeTest.php @@ -5,11 +5,18 @@ declare(strict_types=1); namespace Stancl\Tenancy\Tests; use Tenant; +use Tenancy; class FacadeTest extends TestCase { /** @test */ - public function tenant_manager_can_be_accessed_using_the_Tenant_facade() + public function tenant_manager_can_be_accessed_using_the_Tenancy_facade() + { + $this->assertSame(tenancy()->getTenant(), Tenancy::getTenant()); + } + + /** @test */ + public function tenant_storage_can_be_accessed_using_the_Tenant_facade() { tenant()->put('foo', 'bar'); Tenant::put('abc', 'xyz'); @@ -17,4 +24,10 @@ class FacadeTest extends TestCase $this->assertSame('bar', Tenant::get('foo')); $this->assertSame('xyz', Tenant::get('abc')); } + + /** @test */ + public function tenant_can_be_created_using_the_Tenant_facade() + { + $this->assertSame('bar', Tenant::create(['foo.localhost'], ['foo' => 'bar'])->foo); + } } diff --git a/tests/TenantAssetTest.php b/tests/TenantAssetTest.php index c545364e..45885749 100644 --- a/tests/TenantAssetTest.php +++ b/tests/TenantAssetTest.php @@ -15,14 +15,14 @@ class TenantAssetTest extends TestCase // response()->file() returns BinaryFileResponse whose content is // inaccessible via getContent, so ->assertSee() can't be used - // $this->get(tenant_asset($filename))->assertSuccessful(); // todo commented assertions - // $this->assertFileExists($path); // todo commented assertions + // $this->get(tenant_asset($filename))->assertSuccessful(); // todo2 commented assertions + // $this->assertFileExists($path); // todo2 commented assertions $f = fopen($path, 'r'); $content = fread($f, filesize($path)); fclose($f); - // $this->assertSame('bar', $content); // todo commented assertions + // $this->assertSame('bar', $content); // todo2 commented assertions $this->assertTrue(true); } } diff --git a/tests/TenantDatabaseManagerTest.php b/tests/TenantDatabaseManagerTest.php index a40305a5..9d035b36 100644 --- a/tests/TenantDatabaseManagerTest.php +++ b/tests/TenantDatabaseManagerTest.php @@ -24,7 +24,7 @@ class TenantDatabaseManagerTest extends TestCase $this->markTestSkipped('As to not bloat your computer with test databases, this test is not run by default.'); } - config()->set('database.default', $driver); // todo the DB creator would not work for MySQL when sqlite is used for the central DB + config()->set('database.default', $driver); // todo2 the DB creator would not work for MySQL when sqlite is used for the central DB $name = 'db' . $this->randomString(); $this->assertFalse(app($databaseManager)->databaseExists($name));