'status' => 200,
'body' => 'My name is Bobby.',
'headers' =>
['Cache-Control' => 's-maxage=100'
],
],
];
$this->
setNextResponses($responses);
$this->
request('GET', '/',
[],
[], true
);
$this->
assertEquals('Hello World! My name is Bobby.',
$this->response->
getContent());
$this->
assertNull($this->response->
getTtl());
$this->
assertTrue($this->response->headers->
hasCacheControlDirective('private'
));
$this->
assertTrue($this->response->headers->
hasCacheControlDirective('no-cache'
));
} public function testEsiCacheForceValidationForHeadRequests() { $responses =
[ [ 'status' => 200,
'body' => 'I am the main response and use expiration caching, but I embed another resource: <esi:include src="/foo" />',
'headers' =>
[ 'Cache-Control' => 's-maxage=300',