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")); }
function testCacheHitWithEtagWildcard() { $this->response->setETag("randomly_generated_etag"); $this->request->mock(array("HTTP_IF_NONE_MATCH" => "*")); $this->send(); $this->assertEquals(304, $this->response->getStatus()); }