コード例 #1
0
ファイル: ResponseTest.php プロジェクト: dezvell/mm.local
 /**
  * Test Response Body
  */
 public function testResponseBody()
 {
     $this->expectOutputString('foo');
     $response = new Response();
     $response->setBody('foo');
     $this->assertEquals('foo', $response->getBody());
     $response->send();
 }
コード例 #2
0
ファイル: CacheControlTest.php プロジェクト: dezvell/mm.local
 /**
  * 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'));
 }
コード例 #3
0
 /**
  * Initial Response instance
  * @return void
  */
 protected function initResponse()
 {
     $response = new Http\Response();
     $response->setOptions(Config::getData('response'));
     Response::setInstance($response);
 }
コード例 #4
0
ファイル: ResponseTest.php プロジェクト: dezvell/mm.local
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testSetCookieWithWrongDateNameThrowException()
 {
     $this->response->setCookie('foo', 'bar', 'the day before sunday');
 }