Permalink
Browse files

Merge pull request #3936 from blanchonvincent/hotfix/improve-zend-tes…

…t-and-remove-sendresponselisetener

Improve the remove of SendResponseListener
  • Loading branch information...
2 parents 4805c2e + 6a211d3 commit 4831c93b82f323d503261a32dd6fef14102c1ace @weierophinney weierophinney committed Mar 11, 2013
Showing with 2 additions and 7 deletions.
  1. +2 −7 library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php
@@ -15,7 +15,6 @@
use Zend\Http\Request as HttpRequest;
use Zend\Mvc\Application;
use Zend\Mvc\MvcEvent;
-use Zend\Mvc\SendResponseListener;
use Zend\Stdlib\Exception\LogicException;
use Zend\Stdlib\Parameters;
use Zend\Stdlib\ResponseInterface;
@@ -154,12 +153,8 @@ public function getApplication()
$this->application = Application::init($appConfig);
$events = $this->application->getEventManager();
- foreach ($events->getListeners(MvcEvent::EVENT_FINISH) as $listener) {
- $callback = $listener->getCallback();
- if (is_array($callback) && $callback[0] instanceof SendResponseListener) {
- $events->detach($listener);
- }
- }
+ $events->detach($this->application->getServiceManager()->get('SendResponseListener'));
+
return $this->application;
}

0 comments on commit 4831c93

Please sign in to comment.