Skip to content

Commit

Permalink
Hook behavior bake into BakeShell.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 4, 2014
1 parent 1183ab5 commit 2d3bc93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/Console/Command/BakeShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class BakeShell extends Shell {
*
* @var array
*/
public $tasks = ['Project', 'Model', 'Controller', 'View', 'Plugin', 'Fixture', 'Test'];
public $tasks = ['Behavior', 'Project', 'Model', 'Controller', 'View', 'Plugin', 'Fixture', 'Test'];

/**
* The connection being used.
Expand Down Expand Up @@ -83,6 +83,7 @@ public function main() {
$this->out(__d('cake_console', 'The following commands you can generate skeleton code your your application.'));
$this->out(__d('cake_console', 'Available bake commands:'));
$this->out('');
$this->out(__d('cake_console', 'behavior'));
$this->out(__d('cake_console', 'model'));
$this->out(__d('cake_console', 'view'));
$this->out(__d('cake_console', 'controller'));
Expand Down Expand Up @@ -154,6 +155,9 @@ public function getOptionParser() {
])->addSubcommand('plugin', [
'help' => __d('cake_console', 'Bake a new plugin folder in the path supplied or in current directory if no path is specified.'),
'parser' => $this->Plugin->getOptionParser()
])->addSubcommand('behavior', [
'help' => __d('cake_console', 'Bake a behavior.'),
'parser' => $this->Behavior->getOptionParser()
])->addSubcommand('model', [
'help' => __d('cake_console', 'Bake a model.'),
'parser' => $this->Model->getOptionParser()
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Console/Command/CompletionShellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function testSubCommandsCorePlugin() {
$this->Shell->runCommand('subCommands', array('subCommands', 'CORE.bake'));
$output = $this->Shell->stdout->output;

$expected = "controller fixture model plugin project test view\n";
$expected = "behavior controller fixture model plugin project test view\n";
$this->assertEquals($expected, $output);
}

Expand Down Expand Up @@ -229,7 +229,7 @@ public function testSubCommands() {
$this->Shell->runCommand('subCommands', array('subCommands', 'bake'));
$output = $this->Shell->stdout->output;

$expected = "controller fixture model plugin project test view\n";
$expected = "behavior controller fixture model plugin project test view\n";
$this->assertEquals($expected, $output);
}

Expand Down

0 comments on commit 2d3bc93

Please sign in to comment.