From 0ff126b8f39bb544dba2a818e865fb160d95519d Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Sat, 16 Nov 2024 18:52:51 -0500 Subject: [PATCH] Clear caches after app created. --- tests/TestCase.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index be56d7c..9b165ba 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,6 +5,7 @@ use Illuminate\Contracts\Config\Repository; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Arr; +use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\File; use Lunarstorm\LaravelDDD\LaravelDDDServiceProvider; use Lunarstorm\LaravelDDD\Support\DomainCache; @@ -25,11 +26,14 @@ protected function setUp(): void Factory::guessFactoryNamesUsing( fn (string $modelName) => 'Lunarstorm\\LaravelDDD\\Database\\Factories\\'.class_basename($modelName).'Factory' ); + + DomainCache::clear(); + Artisan::call('optimize:clear'); }); - // $this->beforeApplicationDestroyed(function () { - // $this->cleanSlate(); - // }); + $this->beforeApplicationDestroyed(function () { + $this->cleanSlate(); + }); parent::setUp(); }