$this->
assertNull($response->headers->
get('Age'
), '->expire() does not set the Age when the response is expired'
);
$response =
new Response();
$response->headers->
set('Expires',
date(\DATE_RFC2822,
time() + 600
));
$response->
expire();
$this->
assertNull($response->headers->
get('Expires'
), '->expire() removes the Expires header when the response is fresh'
);
} public function testNullExpireHeader() { $response =
new Response(null, 200,
['Expires' => null
]);
$this->
assertNull($response->
getExpires());
} public function testGetTtl() { $response =
new Response();
$this->
assertNull($response->
getTtl(), '->getTtl() returns null when no Expires or Cache-Control headers are present'
);
$response =
new Response();
$response->headers->
set('Expires',
$this->
createDateTimeOneHourLater()->
format(\DATE_RFC2822
));
$this->
assertEquals(3600,
$response->
getTtl(), '->getTtl() uses the Expires header when no max-age is present'
);