You are here

public function HeaderBagTest::testCacheControlDirectiveParsing in Zircon Profile 8

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

File

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

Class

HeaderBagTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testCacheControlDirectiveParsing() {
  $bag = new HeaderBag(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'));
  $bag
    ->addCacheControlDirective('s-maxage', 100);
  $this
    ->assertEquals('max-age=10, public, s-maxage=100', $bag
    ->get('cache-control'));
}