Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Testcase for Controller::setAction()
  • Loading branch information
josegonzalez committed Jan 15, 2012
1 parent 6046b8d commit ad2472a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/Cake/Test/Case/Controller/ControllerTest.php
Expand Up @@ -273,6 +273,21 @@ public function index($testId, $test2Id) {
);
}


/**
* view method
*
* @param mixed $testId
* @param mixed $test2Id
* @return void
*/
public function view($testId, $test2Id) {
$this->data = array(
'testId' => $testId,
'test2Id' => $test2Id
);
}

public function returner() {
return 'I am from the controller.';
}
Expand Down Expand Up @@ -978,9 +993,10 @@ public function testSetAction() {
$request = new CakeRequest('controller_posts/index');

$TestController = new TestController($request);
$TestController->setAction('index', 1, 2);
$TestController->setAction('view', 1, 2);
$expected = array('testId' => 1, 'test2Id' => 2);
$this->assertSame($expected, $TestController->request->data);
$this->assertSame('view', $TestController->request->params['action']);
$this->assertSame('index', $TestController->view);
}

Expand Down

0 comments on commit ad2472a

Please sign in to comment.