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

Multiple domains test

This commit is contained in:
Samuel Štancl 2019-09-20 18:13:25 +02:00
parent bdaf6cf824
commit b268dd5d50
2 changed files with 11 additions and 1 deletions

View file

@ -7,6 +7,7 @@ namespace Stancl\Tenancy\Tests;
use Mockery;
use Stancl\Tenancy\Contracts\StorageDriver;
use Stancl\Tenancy\Tenant;
use Tenancy;
class TenantClassTest extends TestCase
{
@ -36,4 +37,13 @@ class TenantClassTest extends TestCase
Mockery::close();
}
/** @test */
public function tenant_can_have_multiple_domains()
{
$tenant = Tenant::create(['foo.localhost', 'bar.localhost']);
$this->assertSame(['foo.localhost', 'bar.localhost'], $tenant->domains);
$this->assertSame($tenant->id, Tenancy::findByDomain('foo.localhost')->id);
$this->assertSame($tenant->id, Tenancy::findByDomain('bar.localhost')->id);
}
}