From 117c47c1aad9a90a63e56e7a14bf8e4842690b80 Mon Sep 17 00:00:00 2001 From: Abrar Ahmad Date: Fri, 22 Jul 2022 19:12:40 +0500 Subject: [PATCH] Update DomainTest.php --- tests/DomainTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/DomainTest.php b/tests/DomainTest.php index 01342d78..2fed6ed7 100644 --- a/tests/DomainTest.php +++ b/tests/DomainTest.php @@ -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'); }