Skip to content

A free open source IT asset/license management system

Clear the config and route caching done by optimize command after test

Marcus Moorea56f3f85f876
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();
}
}