/** * Test Response Body */ public function testResponseBody() { $this->expectOutputString('foo'); $response = new Response(); $response->setBody('foo'); $this->assertEquals('foo', $response->getBody()); $response->send(); }
/** * 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')); }
/** * Initial Response instance * @return void */ protected function initResponse() { $response = new Http\Response(); $response->setOptions(Config::getData('response')); Response::setInstance($response); }
/** * @expectedException \InvalidArgumentException */ public function testSetCookieWithWrongDateNameThrowException() { $this->response->setCookie('foo', 'bar', 'the day before sunday'); }