function EntityCacheTagsTestBase::getRenderCacheBackend

Same name and namespace in other branches
  1. 10 core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php \Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase::getRenderCacheBackend()

Retrieves the render cache backend as a variation cache.

This is how Drupal\Core\Render\RenderCache uses the render cache backend.

Return value

\Drupal\Core\Cache\VariationCacheInterface The render cache backend as a variation cache.

2 calls to EntityCacheTagsTestBase::getRenderCacheBackend()
EntityCacheTagsTestBase::verifyRenderCache in core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php
Verify that a given render cache entry exists, with the correct cache tags.
ShortcutCacheTagsTest::testEntityCreation in core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php
Tests that when creating a shortcut, the shortcut set tag is invalidated.

File

core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php, line 642

Class

EntityCacheTagsTestBase
Provides helper methods for Entity cache tags tests.

Namespace

Drupal\Tests\system\Functional\Entity

Code

protected function getRenderCacheBackend() {
    
    /** @var \Drupal\Core\Cache\VariationCacheFactoryInterface $variation_cache_factory */
    $variation_cache_factory = \Drupal::service('variation_cache_factory');
    return $variation_cache_factory->get('render');
}

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