From 77df4675676fca2391d8cb9a4fd948057dcfacc9 Mon Sep 17 00:00:00 2001 From: JapSeyz Date: Sat, 26 Oct 2019 21:18:03 +0200 Subject: [PATCH] Fixes an issue where tests wouldn't have tenants in the tearDown method (#198) * Fixes an issue where tests wouldn't have tenants in the tearDown method * Styling --- src/TenantManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TenantManager.php b/src/TenantManager.php index 9144d2f4..5fe60e90 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -259,6 +259,10 @@ class TenantManager public function endTenancy(): self { + if (! $this->initialized) { + return $this; + } + $prevented = $this->event('ending'); foreach ($this->tenancyBootstrappers($prevented) as $bootstrapper) {