Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding test cases for view task.
  • Loading branch information
markstory committed Sep 23, 2009
1 parent 6dd144b commit c330934
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions cake/console/libs/tasks/view.php
Expand Up @@ -390,7 +390,7 @@ function getContent($action, $vars = null) {
}
return false;
}

/**
* Gets the template name based on the action name
*
Expand All @@ -414,7 +414,6 @@ function getTemplate($action) {
}
return $template;
}


/**
* Displays help contents
Expand Down
18 changes: 18 additions & 0 deletions cake/tests/cases/console/libs/tasks/view.test.php
Expand Up @@ -399,6 +399,24 @@ function testExecuteInteractive() {
$this->Task->execute();
}

/**
* test `cake bake view posts index list`
*
* @return void
**/
function testExecuteWithAlternateTemplates() {
$this->Task->connection = 'test_suite';
$this->Task->args = array('ViewTaskComments', 'index', 'list');
$this->Task->params = array();

$this->Task->expectCallCount('createFile', 1);
$this->Task->expectAt(0, 'createFile', array(
TMP . 'view_task_comments' . DS . 'list.ctp',
new PatternExpectation('/ViewTaskComment/')
));
$this->Task->execute();
}

/**
* test execute into interactive() with admin methods.
*
Expand Down

0 comments on commit c330934

Please sign in to comment.