function PageCacheTagsTestBase::verifyDynamicPageCache
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase::verifyDynamicPageCache()
- 8.9.x core/modules/system/tests/src/Functional/Cache/PageCacheTagsTestBase.php \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase::verifyDynamicPageCache()
- 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.
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\CacheCode
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.