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