Permalink
Browse files

Adding tests.

  • Loading branch information...
1 parent 61ab769 commit b56931383cb7976ed9d6464df299bd96d3269536 @markstory markstory committed with markstory Jul 10, 2011
Showing with 25 additions and 1 deletion.
  1. +25 −1 lib/Cake/Test/Case/Controller/ControllerTest.php
@@ -295,6 +295,10 @@ public function index($testId, $test2Id) {
'test2Id' => $test2Id
);
}
+
+ public function returner() {
+ return 'I am from the controller.';
+ }
protected function protected_m() {
@@ -319,7 +323,6 @@ public function admin_add() {
* @package cake.tests.cases.libs.controller
*/
class TestComponent extends Object {
-
/**
* beforeRedirect method
*
@@ -1374,4 +1377,25 @@ public function testInvokeActionPrefixProtection() {
$Controller = new TestController($url, $response);
$Controller->invokeAction($url);
}
+
+/**
+ * test invoking controller methods.
+ *
+ * @return void
+ */
+ public function testInvokeActionReturnValue() {
+ $url = new CakeRequest('test/returner/');
+ $url->addParams(array(
+ 'controller' => 'test_controller',
+ 'action' => 'returner',
+ 'pass' => array()
+ ));
+ $response = $this->getMock('CakeResponse');
+
+ $Controller = new TestController($url, $response);
+ $result = $Controller->invokeAction($url);
+ $this->assertEquals('I am from the controller.', $result);
+ }
+
+
}

0 comments on commit b569313

Please sign in to comment.