From 43a43a8d5541efa6f9ee099f950645cae82dda44 Mon Sep 17 00:00:00 2001 From: Jesper Jacobsen Date: Tue, 22 Oct 2019 23:55:19 +0200 Subject: [PATCH] Fixes an issue where tests wouldn't have tenants in the tearDown method --- src/TenantManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TenantManager.php b/src/TenantManager.php index 9144d2f4..722ac9e7 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -259,6 +259,8 @@ class TenantManager public function endTenancy(): self { + if (! $this->initialized) { return $this; } + $prevented = $this->event('ending'); foreach ($this->tenancyBootstrappers($prevented) as $bootstrapper) {