Skip to content

Commit

Permalink
Remove app\Modules in cleanSlate()
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Nov 9, 2024
1 parent 7d7c611 commit b2c37f0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
// );

Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'Lunarstorm\\LaravelDDD\\Database\\Factories\\'.class_basename($modelName).'Factory'
fn(string $modelName) => 'Lunarstorm\\LaravelDDD\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
);
});

Expand Down Expand Up @@ -140,7 +140,7 @@ protected function composerReload()

protected function cleanSlate()
{
File::copy(__DIR__.'/.skeleton/composer.json', base_path('composer.json'));
File::copy(__DIR__ . '/.skeleton/composer.json', base_path('composer.json'));

File::delete(base_path('config/ddd.php'));

Expand All @@ -153,6 +153,7 @@ protected function cleanSlate()
File::deleteDirectory(base_path('src/Domain'));
File::deleteDirectory(base_path('src/Domains'));
File::deleteDirectory(base_path('src/App'));
File::deleteDirectory(app_path('Modules'));
File::deleteDirectory(app_path('Models'));

File::deleteDirectory(base_path('bootstrap/cache/ddd'));
Expand All @@ -165,10 +166,10 @@ protected function cleanStubs()

protected function setupTestApplication()
{
File::copyDirectory(__DIR__.'/.skeleton/app', app_path());
File::copyDirectory(__DIR__.'/.skeleton/database', base_path('database'));
File::copyDirectory(__DIR__.'/.skeleton/src/Domain', base_path('src/Domain'));
File::copy(__DIR__.'/.skeleton/bootstrap/providers.php', base_path('bootstrap/providers.php'));
File::copyDirectory(__DIR__ . '/.skeleton/app', app_path());
File::copyDirectory(__DIR__ . '/.skeleton/database', base_path('database'));
File::copyDirectory(__DIR__ . '/.skeleton/src/Domain', base_path('src/Domain'));
File::copy(__DIR__ . '/.skeleton/bootstrap/providers.php', base_path('bootstrap/providers.php'));
File::ensureDirectoryExists(app_path('Models'));

$this->setDomainPathInComposer('Domain', 'src/Domain');
Expand All @@ -178,7 +179,7 @@ protected function setDomainPathInComposer($domainNamespace, $domainPath, bool $
{
$this->updateComposer(
set: [
[['autoload', 'psr-4', $domainNamespace.'\\'], $domainPath],
[['autoload', 'psr-4', $domainNamespace . '\\'], $domainPath],
],
);

Expand Down

0 comments on commit b2c37f0

Please sign in to comment.