ZF-7373: Zend_Test_PHPUnit fails when Controller Plugins request the 'bootstrap' param
Description
When attempting to do the following in a Controller Plugin: \ \
.
.
.
public function preDispatch($request)
{
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
It fails as the bootstrap parameter is not being set upon $this->dispatch() within the X_ControllerTestCase.
Could a $this->run($url) which mimics the Zend_Application::run() be added, that sets the bootstrap param and then executes the dispatch?
Comments
Posted by Jason Webster (jasonistaken) on 2009-08-13T21:30:02.000+0000
Using Zend_Application is not a pre-requisite of using the controller components, and thus, not a pre-requisite of testing your controllers. This can easily be accomplished by the developer in the setUp of their tests.
Posted by Matthew Turland (elazar) on 2009-12-29T11:03:55.000+0000
ZF-8193 includes a work-around for this. As Jason Webster suggested earlier, another work-around involves doing something like the example below in setUp() of the test case. Thanks to [~ralph] for coming up with this code.
Posted by Matthew Weier O'Phinney (matthew) on 2010-01-13T08:20:04.000+0000
Resolved in trunk