Skip to content

Commit

Permalink
Added success message for Execute Command
Browse files Browse the repository at this point in the history
- Added success message before new line for successful migrations
- updated unit tests
  • Loading branch information
craig-patrick committed Jan 17, 2023
1 parent f8fe749 commit f2dfcfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use function is_string;
use function is_writable;
use function sprintf;
use function strtoupper;

/**
* The ExecuteCommand class is responsible for executing migration versions up or down manually.
Expand Down Expand Up @@ -161,6 +162,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$writer->write($path, $direction, $sql);
}

$this->io->success(sprintf(
'Successfully migrated version(s) : %s : [%s]',
implode(', ', $versions),
strtoupper($plan->getDirection())
));
$this->io->newLine();

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function testExecute(): void

self::assertSame(0, $this->executeCommandTester->getStatusCode());
self::assertStringContainsString('[notice] Executing 1 up', trim($this->executeCommandTester->getDisplay(true)));
self::assertStringContainsString('[OK] Successfully migrated version(s) : 1 : [UP]', trim($this->executeCommandTester->getDisplay(true)));
}

public function testExecuteMultiple(): void
Expand Down

0 comments on commit f2dfcfd

Please sign in to comment.