Permalink
Browse files

Improve the remove of SendResponseListener

  • Loading branch information...
blanchonvincent committed Mar 2, 2013
1 parent 9598a97 commit 6a211d33d2bd4d54d2719d54a169fbf3f44a5382
Showing with 2 additions and 7 deletions.
  1. +2 −7 library/Zend/Test/PHPUnit/Controller/AbstractControllerTestCase.php
@@ -14,7 +14,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;
@@ -147,12 +146,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 6a211d3

Please sign in to comment.