You are here

public function CacheControlOverrideMaxAgeTest::testMaxAge in Cache Control Override 8

Test the cache properties in response header data.

File

tests/src/Functional/CacheControlOverrideMaxAgeTest.php, line 36

Class

CacheControlOverrideMaxAgeTest
Tests the cache control override.

Namespace

Drupal\Tests\cache_control_override\Functional

Code

public function testMaxAge() {
  $this
    ->drupalGet('cco');
  $this
    ->assertSession()
    ->responseContains('Max age test content');
  $this
    ->assertSession()
    ->responseHeaderContains('Cache-Control', 'max-age=3600, public');
  $this
    ->drupalGet('cco/333');
  $this
    ->assertSession()
    ->responseHeaderContains('Cache-Control', 'max-age=333, public');
  $this
    ->drupalGet('cco/0');
  $this
    ->assertSession()
    ->responseHeaderContains('Cache-Control', 'max-age=0, public');
}