Skip to content

Commit

Permalink
[10.x] Fixes missing Throwable import and handle if `originalExcept…
Browse files Browse the repository at this point in the history
…ionHandler` or `originalDeprecationHandler` property isn't used by alternative TestCase (#50021)

* [10.x] Fixes missing `Throwable` import.

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* Apply fixes from StyleCI

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
  • Loading branch information
crynobone and StyleCIBot authored Feb 9, 2024
1 parent e18ca8f commit 6821aa1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use Illuminate\View\Component;
use Mockery;
use Mockery\Exception\InvalidCountException;
use Throwable;

trait InteractsWithTestCaseLifecycle
{
Expand Down Expand Up @@ -145,8 +146,13 @@ 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();
Expand Down

0 comments on commit 6821aa1

Please sign in to comment.