You are here

protected function VariationCacheTest::setVariationCacheItem in VariationCache 8

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 tests/src/Unit/VariationCacheTest.php
Tests exception for a cache item that has incompatible variations.
VariationCacheTest::testNestedVariations in tests/src/Unit/VariationCacheTest.php
Tests a cache item that has nested variations.
VariationCacheTest::testNestedVariationsSelfHealing in tests/src/Unit/VariationCacheTest.php
Tests a cache item that has nested variations that trigger self-healing.
VariationCacheTest::testNoVariations in tests/src/Unit/VariationCacheTest.php
Tests a cache item that has no variations.
VariationCacheTest::testSingleVariation in tests/src/Unit/VariationCacheTest.php
Tests a cache item that only ever varies by one context.

... See full list

File

tests/src/Unit/VariationCacheTest.php, line 422

Class

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

Namespace

Drupal\Tests\variationcache\Unit

Code

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