Exemplo n.º 1
0
 public function testComputeTtlWithPublicResponse()
 {
     $handler = new HttpCacheHandler();
     $handler->updateMetadata(Response::create()->setTtl(60));
     $handler->updateMetadata(Response::create()->setTtl(55));
     $handler->updateMetadata(Response::create()->setTtl(42));
     $handler->updateMetadata(Response::create()->setTtl(55));
     $handler->alterResponse($response = Response::create()->setTtl(84));
     $this->assertEquals(42, $response->getTtl());
 }
Exemplo n.º 2
0
 public function testResponseTtlNotAlteredIfNoRenderedBlock()
 {
     $handler = new HttpCacheHandler();
     $handler->alterResponse($response = Response::create()->setTtl(84));
     $this->assertEquals(84, $response->getTtl());
 }