Skip to content

Commit

Permalink
Add test for using autoMock and multiple redirects.
Browse files Browse the repository at this point in the history
Having multiple redirects and not calling generate() before each test, or
using autoMock results in an exit.  This is related to
[c5ca10c] where controller re-use was removed.

Refs #2200
  • Loading branch information
markstory committed Nov 5, 2011
1 parent 812e449 commit 61d6a72
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
Expand Up @@ -471,6 +471,7 @@ public function testNoMocking() {
* @return void
*/
public function testNoControllerReuse() {
$this->Case->autoMock = true;
$result = $this->Case->testAction('/tests_apps/index', array(
'data' => array('var' => 'first call'),
'method' => 'get',
Expand All @@ -496,4 +497,18 @@ public function testNoControllerReuse() {
$this->assertContains('third call', $result);
}

/**
* Test that multiple calls to redirect in the same test method don't cause issues.
*
* @return void
*/
public function testTestActionWithMultipleRedirect() {
$this->Case->autoMock = true;
$Controller = $this->Case->generate('TestsApps');

$options = array('method' => 'get');
$this->Case->testAction('/tests_apps/redirect_to', $options);
$this->Case->testAction('/tests_apps/redirect_to', $options);
}

}

0 comments on commit 61d6a72

Please sign in to comment.