$response->headers->
set('Vary',
$vary);
$this->
assertEquals($vary,
$response->
getVary(), '->getVary() parses multiple header name values in arrays'
);
$response =
new Response();
$response->headers->
set('Vary', 'Accept-Language, User-Agent, X-foo'
);
$this->
assertEquals($vary,
$response->
getVary(), '->getVary() parses multiple header name values in arrays'
);
} public function testSetVary() { $response =
new Response();
$response->
setVary('Accept-Language'
);
$this->
assertEquals(['Accept-Language'
],
$response->
getVary());
$response->
setVary('Accept-Language, User-Agent'
);
$this->
assertEquals(['Accept-Language', 'User-Agent'
],
$response->
getVary(), '->setVary() replace the vary header by default'
);
$response->
setVary('X-Foo', false
);
$this->
assertEquals(['Accept-Language', 'User-Agent', 'X-Foo'
],
$response->
getVary(), '->setVary() doesn\'t wipe out earlier Vary headers if replace is set to false'
);
} public function testDefaultContentType() {