Skip to content

Commit

Permalink
Clear caches after app created.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperTey committed Nov 16, 2024
1 parent 5e17ad2 commit 0ff126b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down

0 comments on commit 0ff126b

Please sign in to comment.