Skip to content
Permalink
Browse files

Provides backward compatibility for the CommandTask::subCommands() me…

…thod
  • Loading branch information...
HavokInspiration committed Dec 3, 2015
1 parent 82e315a commit 58ca4303d73c1702a019fe9a63f9ba6b30be6a10
Showing with 15 additions and 1 deletion.
  1. +1 −1 src/Shell/Task/CommandTask.php
  2. +14 −0 tests/TestCase/Shell/CompletionShellTest.php
@@ -186,7 +186,7 @@ public function getShell($commandName)
$pluginDot = '';
}
if (!in_array($commandName, $this->commands())) {
if (!in_array($commandName, $this->commands()) && (empty($pluginDot) && !in_array($name, $this->commands()))) {
return false;
}
@@ -209,6 +209,20 @@ public function testSubCommandsPlugin()
$this->assertTextEquals($expected, $output);
}
/**
* test that using the dot notation when not mandatory works to provide backward compatibility
*
* @return void
*/
public function testSubCommandsPluginDotNotationBackwardCompatibility()
{
$this->Shell->runCommand(['subcommands', 'TestPluginTwo.welcome']);
$output = $this->out->output;
$expected = "say_hello\n";
$this->assertTextEquals($expected, $output);
}
/**
* test that subCommands with an existing plugin command returns the proper sub commands
*

0 comments on commit 58ca430

Please sign in to comment.
You can’t perform that action at this time.