Skip to content

Commit

Permalink
Expand test coverage for controller task.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 31, 2014
1 parent 0667ff2 commit 2a85ffe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Console/Command/Task/ControllerTask.php
Expand Up @@ -63,7 +63,7 @@ public function execute() {
}

if (empty($this->args)) {
$this->out(__d('cake_console', 'Possible Controllers based on your current database:'));
$this->out(__d('cake_console', 'Possible controllers based on your current database:'));
foreach ($this->listAll() as $table) {
$this->out('- ' . $this->_controllerName($table));
}
Expand Down
16 changes: 16 additions & 0 deletions tests/TestCase/Console/Command/Task/ControllerTaskTest.php
Expand Up @@ -269,6 +269,22 @@ public function testBakeTestDisabled() {
$this->Task->bakeTest('BakeArticles');
}

/**
* Test execute no args.
*
* @return void
*/
public function testExecuteNoArgs() {
$this->Task->expects($this->never())
->method('createFile');

$this->Task->expects($this->at(0))
->method('out')
->with($this->stringContains('Possible controllers based on your current database'));

$this->Task->execute();
}

/**
* test that execute runs all when the first arg == all
*
Expand Down

0 comments on commit 2a85ffe

Please sign in to comment.