Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.6.0RC2
-
Fix Version/s: 1.6.1
-
Component/s: Zend_Test_PHPUnit
-
Labels:None
-
Fix Version Priority:Must Have
Description
<?php class Controllers_Default_IndexControllerTest extends Zend_Test_PHPUnit_ControllerTestCase { public function testIndexAction() { $this->request->setQuery('mr', 'proper'); $this->dispatch('/index/index?james=bond'); var_dump($this->request->getParams()); =====echoes====== ....................................array(4) { ["controller"]=> string(5) "index" ["action"]=> string(5) "index" ["module"]=> string(7) "default" ["james"]=> string(4) "bond" }
Why 'mr' GET param is not set?
The parameter is not set because you passed parameters via the query string; these overwrite those previously set with setQuery().
Either set all GET parameters using setQuery() or pass them as part of the URL to dispatch.