/**
  * @test
  */
 public function toolbarIsAppendedWhenContentTypeIsHtml()
 {
     $this->body->expects($this->once())->method('isWritable')->will($this->returnValue(true));
     $this->body->expects($this->once())->method('write');
     $this->response->expects($this->once())->method('getHeader')->will($this->returnValue(['text/html']));
     $this->middleware->__invoke($this->request, $this->response);
 }
 public function seeksToTheBodyEOFPriorToWriting()
 {
     $this->body->expects($this->once())->method('isWritable')->will($this->returnValue(true));
     $this->body->expects($this->once())->method('eof')->will($this->returnValue(false));
     $this->body->expects($this->once())->method('isSeekable')->will($this->returnValue(true));
     $this->body->expects($this->once())->method('seek')->with($this->equalTo(0), $this->equalTo(SEEK_END))->will($this->returnValue(true));
     $this->body->expects($this->once())->method('write');
     $this->response->expects($this->once())->method('getHeaderLine')->will($this->returnValue('text/html'));
     $this->middleware->__invoke($this->request, $this->response);
 }
 public function testGetStatusCode()
 {
     $statusCode = 'some-code';
     $this->response->expects($this->atLeastOnce())->method('getStatusCode')->willReturn($statusCode);
     $this->assertSame($statusCode, $this->httpException->getStatusCode());
 }