function PageCacheTagsTestBase::verifyDynamicPageCache

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase::verifyDynamicPageCache()
  2. 8.9.x core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase::verifyDynamicPageCache()
  3. 11.x core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase::verifyDynamicPageCache()

Verify that when loading a given page, it's a page cache hit or miss.

Parameters

\Drupal\Core\Url $url: The page for this URL will be loaded.

string $hit_or_miss: 'HIT' if a page cache hit is expected, 'MISS' otherwise.

6 calls to PageCacheTagsTestBase::verifyDynamicPageCache()
NavigationShortcutsBlockTest::testNavigationBlock in core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php
Tests visibility and cacheability of shortcuts in the navigation bar.
NavigationUserBlockTest::testNavigationUserBlock in core/modules/navigation/tests/src/Functional/NavigationUserBlockTest.php
Test output of user navigation block with regards to caching and contents.
ShortcutCacheTagsTest::testBlock in core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
Tests visibility and cacheability of shortcuts in the block.
ShortcutCacheTagsTest::testToolbar in core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
Tests visibility and cacheability of shortcuts in the toolbar.
ShortcutsNavigationBlockTest::testNavigationBlock in core/modules/navigation/tests/src/Functional/ShortcutsNavigationBlockTest.php
Tests visibility and cacheability of shortcuts in the navigation bar.

... See full list

File

core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php, line 62

Class

PageCacheTagsTestBase
Provides helper methods for page cache tags tests.

Namespace

Drupal\Tests\system\Functional\Cache

Code

protected function verifyDynamicPageCache(Url $url, $hit_or_miss) {
    $this->drupalGet($url);
    $this->assertSession()
        ->responseHeaderEquals('X-Drupal-Dynamic-Cache', $hit_or_miss);
}

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