function AssertPageCacheContextsAndTagsTrait::assertCacheMaxAge

Asserts the max age header.

Parameters

int $max_age:

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Cache

Code

protected function assertCacheMaxAge($max_age) {
  $cache_control_header = $this->drupalGetHeader('Cache-Control');
  $this->assertStringContainsString('max-age:' . $max_age, $cache_control_header);
}

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