diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index c5007f9ab..2fa946275 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -471,6 +471,7 @@ class ControllerTestCaseTest extends CakeTestCase { * @return void */ public function testNoControllerReuse() { + $this->Case->autoMock = true; $result = $this->Case->testAction('/tests_apps/index', array( 'data' => array('var' => 'first call'), 'method' => 'get', @@ -496,4 +497,18 @@ class ControllerTestCaseTest extends CakeTestCase { $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); + } + }