Esempio n. 1
0
 function testSetETag()
 {
     $resp = new Response();
     $resp->setETag("abc");
     $this->assertEquals('"abc"', $resp->getHeader("ETag"));
     $resp->setETag("abc", true);
     $this->assertEquals('W/"abc"', $resp->getHeader("ETag"));
 }
Esempio n. 2
0
 function testCacheHitWithEtagWildcard()
 {
     $this->response->setETag("randomly_generated_etag");
     $this->request->mock(array("HTTP_IF_NONE_MATCH" => "*"));
     $this->send();
     $this->assertEquals(304, $this->response->getStatus());
 }