function ToolbarCacheContextsTest::testCacheIntegration

Same name and namespace in other branches
  1. 9 core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php \Drupal\Tests\toolbar\Functional\ToolbarCacheContextsTest::testCacheIntegration()
  2. 10 core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php \Drupal\Tests\toolbar\Functional\ToolbarCacheContextsTest::testCacheIntegration()
  3. 11.x core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php \Drupal\Tests\toolbar\Functional\ToolbarCacheContextsTest::testCacheIntegration()

Tests toolbar cache integration.

File

core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php, line 69

Class

ToolbarCacheContextsTest
Tests the cache contexts for toolbar.

Namespace

Drupal\Tests\toolbar\Functional

Code

public function testCacheIntegration() {
    $this->installExtraModules([
        'dynamic_page_cache',
    ]);
    $this->drupalLogin($this->adminUser);
    $this->drupalGet('test-page');
    $this->assertSame('MISS', $this->getSession()
        ->getResponseHeader('X-Drupal-Dynamic-Cache'));
    $this->drupalGet('test-page');
    $this->assertSame('HIT', $this->getSession()
        ->getResponseHeader('X-Drupal-Dynamic-Cache'));
}

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