From 3b275143eaca483569b0048b97a21f6d8118f58d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 9 Feb 2024 10:13:11 +0800 Subject: [PATCH 1/3] [10.x] Fixes missing `Throwable` import. Signed-off-by: Mior Muhammad Zaki --- .../Testing/Concerns/InteractsWithTestCaseLifecycle.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php index 42a929a51388..522c4478fc64 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php @@ -25,6 +25,7 @@ use Illuminate\View\Component; use Mockery; use Mockery\Exception\InvalidCountException; +use Throwable; trait InteractsWithTestCaseLifecycle { From 55f59518e9b6fbfd48184eb5279aab4c92d1c57f Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Fri, 9 Feb 2024 14:48:47 +0800 Subject: [PATCH 2/3] wip Signed-off-by: Mior Muhammad Zaki --- .../Concerns/InteractsWithTestCaseLifecycle.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php index 522c4478fc64..21237b309f05 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php @@ -146,8 +146,14 @@ protected function tearDownTheTestEnvironment(): void $this->afterApplicationCreatedCallbacks = []; $this->beforeApplicationDestroyedCallbacks = []; - $this->originalExceptionHandler = null; - $this->originalDeprecationHandler = null; + + if (property_exists($this, 'originalExceptionHandler')) { + $this->originalExceptionHandler = null; + } + + if (property_exists($this, 'originalDeprecationHandler')) { + $this->originalDeprecationHandler = null; + } AboutCommand::flushState(); Artisan::forgetBootstrappers(); From e051c9b86cab95ee807869150ca7b17a7624a525 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Fri, 9 Feb 2024 06:49:04 +0000 Subject: [PATCH 3/3] Apply fixes from StyleCI --- .../Testing/Concerns/InteractsWithTestCaseLifecycle.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php index 21237b309f05..eb699b3e967e 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithTestCaseLifecycle.php @@ -146,7 +146,6 @@ protected function tearDownTheTestEnvironment(): void $this->afterApplicationCreatedCallbacks = []; $this->beforeApplicationDestroyedCallbacks = []; - if (property_exists($this, 'originalExceptionHandler')) { $this->originalExceptionHandler = null; }