Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding test cases for view task.

  • Loading branch information...
commit c330934b93df9d565dc6403c3e982a47da54e6a6 1 parent 6dd144b
@markstory markstory authored
View
3  cake/console/libs/tasks/view.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
View
18 cake/tests/cases/console/libs/tasks/view.test.php
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.