mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Add test for using autoMock and multiple redirects.
Having multiple redirects and not calling generate() before each test, or
using autoMock results in an exit. This is related to
[c5ca10ca69
] where controller re-use was removed.
Refs #2200
This commit is contained in:
parent
812e449680
commit
61d6a720d6
1 changed files with 15 additions and 0 deletions
|
@ -471,6 +471,7 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testNoControllerReuse() {
|
public function testNoControllerReuse() {
|
||||||
|
$this->Case->autoMock = true;
|
||||||
$result = $this->Case->testAction('/tests_apps/index', array(
|
$result = $this->Case->testAction('/tests_apps/index', array(
|
||||||
'data' => array('var' => 'first call'),
|
'data' => array('var' => 'first call'),
|
||||||
'method' => 'get',
|
'method' => 'get',
|
||||||
|
@ -496,4 +497,18 @@ class ControllerTestCaseTest extends CakeTestCase {
|
||||||
$this->assertContains('third call', $result);
|
$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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue