public function testContentSentAndHeadersSent()
 {
     $mockResponse = $this->getMockForAbstractClass('Zend\\Stdlib\\ResponseInterface');
     $mockResponse2 = $this->getMockForAbstractClass('Zend\\Stdlib\\ResponseInterface');
     $event = new SendResponseEvent();
     $event->setResponse($mockResponse);
     $this->assertFalse($event->headersSent());
     $this->assertFalse($event->contentSent());
     $event->setHeadersSent();
     $event->setContentSent();
     $this->assertTrue($event->headersSent());
     $this->assertTrue($event->contentSent());
     $event->setResponse($mockResponse2);
     $this->assertFalse($event->headersSent());
     $this->assertFalse($event->contentSent());
 }
Example #2
0
 /**
  * Renders the Response object.
  *
  * @param Response $response Rcm Response Object
  *
  * @return void
  */
 protected function renderResponse(Response $response)
 {
     $sendEvent = new SendResponseEvent();
     $sendEvent->setResponse($response);
     $this->responseSender->__invoke($sendEvent);
 }