Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve the remove of SendResponseListener

  • Loading branch information...
commit 6a211d33d2bd4d54d2719d54a169fbf3f44a5382 1 parent 9598a97
@blanchonvincent blanchonvincent authored
View
9 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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.