function AssertPageCacheContextsAndTagsTrait::assertCacheMaxAge

Asserts the max age header.

Parameters

int $max_age: The maximum age of the cache.

File

core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php, line 154

Class

AssertPageCacheContextsAndTagsTrait
Provides test assertions for testing page-level cache contexts & tags.

Namespace

Drupal\Tests\system\Functional\Cache

Code

protected function assertCacheMaxAge($max_age) {
  $this->assertSession()
    ->responseHeaderContains('Cache-Control', 'max-age:' . $max_age);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.