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()); }
public function testResponseTtlNotAlteredIfNoRenderedBlock() { $handler = new HttpCacheHandler(); $handler->alterResponse($response = Response::create()->setTtl(84)); $this->assertEquals(84, $response->getTtl()); }