function VariationCacheTest::setVariationCacheItem

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php \Drupal\Tests\Core\Cache\VariationCacheTest::setVariationCacheItem()

Stores an item in the variation cache.

Parameters

mixed $data: The data that should be stored.

\Drupal\Core\Cache\CacheableMetadata $cacheability: The cacheability that should be used.

\Drupal\Core\Cache\CacheableMetadata $initial_cacheability: The initial cacheability that should be used.

6 calls to VariationCacheTest::setVariationCacheItem()
VariationCacheTest::testIncompatibleVariationsException in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests exception for a cache item that has incompatible variations.
VariationCacheTest::testNestedVariations in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests a cache item that has nested variations.
VariationCacheTest::testNestedVariationsSelfHealing in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests a cache item that has nested variations that trigger self-healing.
VariationCacheTest::testNoVariations in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests a cache item that has no variations.
VariationCacheTest::testSingleVariation in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests a cache item that only ever varies by one context.

... See full list

File

core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php, line 453

Class

VariationCacheTest
@coversDefaultClass \Drupal\Core\Cache\VariationCache @group Cache

Namespace

Drupal\Tests\Core\Cache

Code

protected function setVariationCacheItem($data, CacheableMetadata $cacheability, CacheableMetadata $initial_cacheability) {
    $this->variationCache
        ->set($this->cacheKeys, $data, $cacheability, $initial_cacheability);
}

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