You are here

public function HeaderBagTest::testCacheControlDirectiveOverrideWithReplace in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/HeaderBagTest.php \Symfony\Component\HttpFoundation\Tests\HeaderBagTest::testCacheControlDirectiveOverrideWithReplace()

File

vendor/symfony/http-foundation/Tests/HeaderBagTest.php, line 178

Class

HeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testCacheControlDirectiveOverrideWithReplace() {
  $bag = new HeaderBag(array(
    'cache-control' => 'private, max-age=100',
  ));
  $bag
    ->replace(array(
    'cache-control' => 'public, max-age=10',
  ));
  $this
    ->assertTrue($bag
    ->hasCacheControlDirective('public'));
  $this
    ->assertTrue($bag
    ->getCacheControlDirective('public'));
  $this
    ->assertTrue($bag
    ->hasCacheControlDirective('max-age'));
  $this
    ->assertEquals(10, $bag
    ->getCacheControlDirective('max-age'));
}