From c09bab880831456a5e34aea3f6f51dba7e7f4646 Mon Sep 17 00:00:00 2001 From: ucan-lab <35098175+ucan-lab@users.noreply.github.com> Date: Sat, 12 Feb 2022 00:25:17 +0900 Subject: [PATCH] feat Execute the dacapo command after dacapo:init (#172) --- src/Dacapo/Presentation/Console/DacapoInitCommand.php | 7 ++----- tests/Application/UseCase/DacapoInitCommandTest.php | 2 +- tests/TestCase.php | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Dacapo/Presentation/Console/DacapoInitCommand.php b/src/Dacapo/Presentation/Console/DacapoInitCommand.php index 39dd5c4b..906232ac 100644 --- a/src/Dacapo/Presentation/Console/DacapoInitCommand.php +++ b/src/Dacapo/Presentation/Console/DacapoInitCommand.php @@ -19,7 +19,7 @@ final class DacapoInitCommand extends Command * @var string */ protected $signature = 'dacapo:init - {--no-clear : Do not execute the dacapo:clear command} + {--no-migrate : Do not migrate} {--laravel6 : Laravel 6.x default schema} {--laravel7 : Laravel 7.x default schema} {--laravel8 : Laravel 8.x default schema} @@ -41,10 +41,6 @@ public function handle(Filesystem $filesystem): void $filesystem->makeDirectory($schemasPath); } - if ($this->option('no-clear') === false) { - $this->call('dacapo:clear', ['--force' => true, '--all' => true]); - } - $version = 'laravel8'; if ($this->option('laravel8')) { @@ -60,5 +56,6 @@ public function handle(Filesystem $filesystem): void file_put_contents($to, file_get_contents($from)); $this->line('Generated: database/schemas/default.yml'); + $this->call('dacapo', ['--no-migrate' => $this->option('no-migrate')]); } } diff --git a/tests/Application/UseCase/DacapoInitCommandTest.php b/tests/Application/UseCase/DacapoInitCommandTest.php index ee66ff4d..5fdfd6d1 100644 --- a/tests/Application/UseCase/DacapoInitCommandTest.php +++ b/tests/Application/UseCase/DacapoInitCommandTest.php @@ -10,6 +10,6 @@ final class DacapoInitCommandTest extends TestCase public function testResolve(): void { $this->app->register(ConsoleServiceProvider::class); - $this->artisan('dacapo:init')->assertExitCode(0); + $this->artisan('dacapo:init', ['--no-migrate' => true])->assertExitCode(0); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 0e771fd9..7a1cbc1b 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -11,7 +11,7 @@ abstract class TestCase extends OrchestraTestCase * Call artisan command and return code. * * @param string $command - * @param array $parameters + * @param array $parameters * @return PendingCommand */ public function artisan($command, $parameters = []): PendingCommand