Permalink
Browse files

Adding test cases for view task.

  • Loading branch information...
1 parent 6dd144b commit c330934b93df9d565dc6403c3e982a47da54e6a6 @markstory markstory committed Sep 23, 2009
Showing with 19 additions and 2 deletions.
  1. +1 −2 cake/console/libs/tasks/view.php
  2. +18 −0 cake/tests/cases/console/libs/tasks/view.test.php
@@ -390,7 +390,7 @@ function getContent($action, $vars = null) {
}
return false;
}
-
+
/**
* Gets the template name based on the action name
*
@@ -414,7 +414,6 @@ function getTemplate($action) {
}
return $template;
}
-
/**
* Displays help contents
@@ -400,6 +400,24 @@ function testExecuteInteractive() {
}
/**
+ * 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.
*
* @return void

0 comments on commit c330934

Please sign in to comment.