Issue Type: Bug Created: 2010-03-23T11:47:21.000+0000 Last Updated: 2012-11-20T21:38:14.000+0000 Status: Open Fix version(s): Reporter: Thomas Bachmann (thobach) Assignee: None Tags: - Zend_Controller
Related issues: Attachments:
When I call $this->_helper->autoCompleteDojo($matches) as stated in the documentation my PHPUnit tests crash without any response.
<pre class="highlight">ThomasMBP:tests thobach$ /usr/local/zend/bin/phpunit PHPUnit 3.4.11 by Sebastian Bergmann. F...ThomasMBP:tests thobach$
The reason is that exit; is called in Zend_Controller_Action_Helper_AutoComplete_Abstract when $suppressExit == false.
The class Zend_Test_PHPUnit_ControllerTestCase already disables the exit statement (setExit(false), suppressExit) for: * $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector'); * $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
But it is not done for all the other possible exits in Zend Framework: * Zend/OpenId.php * Zend/Controller/Action/Helper/AutoComplete/Abstract.php * Zend/ProgressBar/Adapter/JsPull.php * ZendX/Console/Process/Unix.php
When I try to overload the dispatch function in my abstract class ControllerTestCase (extends Zend_Test_PHPUnit_ControllerTestCase) and add the following:
<pre class="highlight"> $dojo = Zend_Controller_Action_HelperBroker::getStaticHelper('autoCompleteDojo'); $dojo->suppressExit = true;
nothing happens. Maybe autoCompleteDojo cannot be called via getStaticHelper.
So what I did was not using autoCompleteDojo as documented, but rather:
<pre class="highlight"> $dojoHelper = $this->_helper->autoCompleteDojo; $dojoHelper->suppressExit = true; $dojoHelper->direct($matches);
If you have further questions, I am glad to help.
No comments to display
Have you found an issue?
See the Overview section for more details.