public function ResponseTest::testSetVary in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/http-foundation/Tests/ResponseTest.php \Symfony\Component\HttpFoundation\Tests\ResponseTest::testSetVary()
File
- vendor/
symfony/ http-foundation/ Tests/ ResponseTest.php, line 425
Class
Namespace
Symfony\Component\HttpFoundation\TestsCode
public function testSetVary() {
$response = new Response();
$response
->setVary('Accept-Language');
$this
->assertEquals(array(
'Accept-Language',
), $response
->getVary());
$response
->setVary('Accept-Language, User-Agent');
$this
->assertEquals(array(
'Accept-Language',
'User-Agent',
), $response
->getVary(), '->setVary() replace the vary header by default');
$response
->setVary('X-Foo', false);
$this
->assertEquals(array(
'Accept-Language',
'User-Agent',
'X-Foo',
), $response
->getVary(), '->setVary() doesn\'t wipe out earlier Vary headers if replace is set to false');
}