Skip to content

Commit

Permalink
[9.x] Forget component's cache and factory between tests (#44648)
Browse files Browse the repository at this point in the history
* Forget component's cache and factory between tests

* Apply fixes from StyleCI

* Adds `forgetComponentsResolver`

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
nunomaduro and StyleCIBot authored Oct 19, 2022
1 parent bb2baa1 commit 7b833a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Foundation/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Support\Facades\ParallelTesting;
use Illuminate\Support\Str;
use Illuminate\Testing\AssertableJsonString;
use Illuminate\View\Component;
use Mockery;
use Mockery\Exception\InvalidCountException;
use PHPUnit\Framework\ExpectationFailedException;
Expand Down Expand Up @@ -222,6 +223,9 @@ protected function tearDown(): void
$this->originalDeprecationHandler = null;

Artisan::forgetBootstrappers();
Component::flushCache();
Component::forgetComponentsResolver();
Component::forgetFactory();
Queue::createPayloadUsing(null);
HandleExceptions::forgetApp();

Expand Down

0 comments on commit 7b833a9

Please sign in to comment.