how to reset or delete request params in EcomDev_PHPUnit?
-
29-09-2020 - |
Question
How to completely reset a request params between dispatches ?
In Ecomdev_Phpunit I did an upload test, set request like this:
$this->getRequest()->setParam('upload', "");
and params becomes:
$this->getRequest()->getParams();
array (
'upload' => '',
)
Then I want to make another test, but i need that upload
empty param to be deleted.
How to I get rid of these parameter in scope of single test ?
Solution
It could be done with
$this->getRequest()->resetParams();
In case of the base EcomDev_PHPUnit_Test_Case, this is not possible. Alternatively, the default request is available via Mage::app()->getRequest()
then.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange