From a56f3f85f87656459c55c238e4f7010284699d6c Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 17 Jul 2024 12:21:46 -0700 Subject: [PATCH] Clear the config and route caching done by optimize command after test --- tests/Feature/Console/OptimizeTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/Feature/Console/OptimizeTest.php b/tests/Feature/Console/OptimizeTest.php index 93db05627a..8dd6f270f9 100644 --- a/tests/Feature/Console/OptimizeTest.php +++ b/tests/Feature/Console/OptimizeTest.php @@ -2,13 +2,17 @@ namespace Tests\Feature\Console; -use Illuminate\Support\Facades\Artisan; use Tests\TestCase; class OptimizeTest extends TestCase { public function testOptimizeSucceeds() { + $this->beforeApplicationDestroyed(function () { + $this->artisan('config:clear'); + $this->artisan('route:clear'); + }); + $this->artisan('optimize')->assertSuccessful(); } }