Example #1
0
 /**
  * Test Response Body
  */
 public function testResponseBody()
 {
     $this->expectOutputString('foo');
     $response = new Response();
     $response->setBody('foo');
     $this->assertEquals('foo', $response->getBody());
     $response->send();
 }
Example #2
0
 /**
  * Test Expires
  */
 public function testLastModifiedAsDate()
 {
     $date = new \DateTime('2012-12-12T12:12:12+00:00');
     $this->cacheControl->setLastModified($date);
     $this->assertEquals('Wed, 12 Dec 2012 12:12:12 GMT', $this->cacheControl->getLastModified());
     $this->assertEquals('Wed, 12 Dec 2012 12:12:12 GMT', $this->response->getHeader('Last-Modified'));
 }
Example #3
0
 /**
  * Initial Response instance
  * @return void
  */
 protected function initResponse()
 {
     $response = new Http\Response();
     $response->setOptions(Config::getData('response'));
     Response::setInstance($response);
 }
Example #4
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testSetCookieWithWrongDateNameThrowException()
 {
     $this->response->setCookie('foo', 'bar', 'the day before sunday');
 }