function VariationCacheTest::setVariationCacheItem

Same name in other branches
  1. 10 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.

10 calls to VariationCacheTest::setVariationCacheItem()
VariationCacheTest::testIncompatibleChainedRedirectsComplexException in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests the same as above, but even more complex.
VariationCacheTest::testIncompatibleChainedRedirectsException in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests the same as above, but with more redirects.
VariationCacheTest::testIncompatibleRedirectsException in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests exception for a cache item that has incompatible cache redirects.
VariationCacheTest::testIncompleteRedirectException in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests exception for a cache item that has an incomplete redirect.
VariationCacheTest::testIncompleteVariationsException in core/tests/Drupal/Tests/Core/Cache/VariationCacheTest.php
Tests exception for a cache item that has incomplete variations.

... See full list

File

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

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.