Description

When running the Zend_Controller_Plugin test suite ({{./runtests.sh Controller_Plugin}}) I get the following error:

Starting test 'Zend_Controller_Plugin_BrokerTest::testBrokerCatchesExceptions'.
PHP Fatal error: Call to a member function setDispatched() on a non-object in /usr/local/apache2/htdocs/lib/zfdev/trunk/library/Zend/Controller/Plugin/Broker.php on line 316

Comments

In unit test {{Zend_Controller_Plugin_BrokerTest::testBrokerCatchesExceptions}}, the broker instance is only given the request object as a parameter to the hook methods (in this case, {{preDispatch}}), and not injected via {{setRequest}}. This causes {{Zend_Controller_Plugin_Broker::preDispatch}} to throw a PHP fatal error because it calls {{$this->getRequest()->setDispatched(false)}}: