Skip to content

Commit

Permalink
Merge pull request #718 from cakephp/backend-config-help
Browse files Browse the repository at this point in the history
Include the current backend in the entry point output
  • Loading branch information
markstory authored May 13, 2024
2 parents 13dc600 + 61859b9 commit c3eef97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Command/EntryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Cake\Console\CommandCollectionAwareInterface;
use Cake\Console\ConsoleIo;
use Cake\Console\Exception\ConsoleException;
use Cake\Core\Configure;

/**
* Command that provides help and an entry point to migrations tools.
Expand Down Expand Up @@ -82,11 +83,14 @@ public function run(array $argv, ConsoleIo $io): ?int

// This is the variance from Command::run()
if (!$args->getArgumentAt(0) && $args->getOption('help')) {
$backend = Configure::read('Migrations.backend', 'phinx');
$io->out([
'<info>Migrations</info>',
'',
"Migrations provides commands for managing your application's database schema and initial data.",
'',
"Using <info>{$backend}</info> backend.",
'',
]);
$help = $this->getHelp();
$this->executeCommand($help, [], $io);
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Command/EntryCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function testExecuteHelp()
$this->exec('migrations --help');

$this->assertExitSuccess();
$this->assertOutputContains('Using <info>builtin</info> backend');
$this->assertOutputContains('Available Commands');
$this->assertOutputContains('migrations migrate');
$this->assertOutputContains('migrations status');
Expand Down

0 comments on commit c3eef97

Please sign in to comment.