Hi there,
in my unit test I'm trying to pass $_GET
parameters to a controller action as follows:
$this->dispatcher->setControllerName('index');
$this->dispatcher->setActionName('someAction');
$this->dispatcher->setParams(array('a' => 'test1', 'b' => 'test2'));
$this->dispatcher->dispatch();
$view = $this->di->get('view');
$view->render('index', 'someAction');
$this->assertEquals($view->data['result'], 'success');
But the get params are not there in the controller. It just returns an empty array when I'm calling $this->request->getQuery();
in the controller.
It works when I'm setting the $_GET
variable directly.
Is there any other way to do this cleanly in a unit test?