1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 13:14:05 +00:00

Add TenantDoesNotExist exception, fix queued migrator serialization

This commit is contained in:
Samuel Štancl 2019-10-16 08:37:30 +02:00
parent e98db460ec
commit 2f3924531d
5 changed files with 41 additions and 6 deletions

View file

@ -8,6 +8,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Facades\Storage;
use Stancl\Tenancy\Exceptions\DomainsOccupiedByOtherTenantException;
use Stancl\Tenancy\Exceptions\TenantDoesNotExistException;
use Stancl\Tenancy\Exceptions\TenantWithThisIdAlreadyExistsException;
use Stancl\Tenancy\Jobs\QueuedTenantDatabaseMigrator;
use Stancl\Tenancy\Tenant;
@ -266,4 +267,11 @@ class TenantManagerTest extends TestCase
(new QueuedTenantDatabaseMigrator($tenant))->handle();
$this->assertTrue(\Schema::hasTable('users'));
}
/** @test */
public function TenantDoesNotExistException_is_thrown_when_find_is_called_on_an_id_that_does_not_belong_to_any_tenant()
{
$this->expectException(TenantDoesNotExistException::class);
tenancy()->find('gjnfdgf');
}
}