1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 08:24:03 +00:00

Update DomainTest.php

This commit is contained in:
Abrar Ahmad 2022-07-22 19:12:40 +05:00
parent 17fecf29a1
commit 117c47c1aa

View file

@ -13,6 +13,7 @@ use Stancl\Tenancy\Exceptions\TenantCouldNotBeIdentifiedOnDomainException;
use Stancl\Tenancy\Features\UniversalRoutes;
use Stancl\Tenancy\Middleware\InitializeTenancyByDomain;
use Stancl\Tenancy\Resolvers\DomainTenantResolver;
use function Symfony\Component\String\s;
class DomainTest extends TestCase
{
@ -109,11 +110,15 @@ class DomainTest extends TestCase
/** @test */
public function not_defining_onfail_customized_logic_throw_correct_exception_when_universal_route_feature_enabled()
{
$this->expectException(TenantCouldNotBeIdentifiedOnDomainException::class);
// un-define onFail logic
InitializeTenancyByDomain::$onFail = null;
// Enable UniversalRoute feature
Route::middlewareGroup('universal', []);
config(['tenancy.features' => [UniversalRoutes::class]]);
$this->expectException(TenantCouldNotBeIdentifiedOnDomainException::class);
$this->withoutExceptionHandling()->get('http://foo.localhost/foo/abc/xyz');
}