You are here

public function VariationCacheTest::testNoVariations in VariationCache 8

Tests a cache item that has no variations.

@covers ::get @covers ::set

File

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

Class

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

Namespace

Drupal\Tests\variationcache\Unit

Code

public function testNoVariations() {
  $data = 'You have a nice house!';
  $cacheability = (new CacheableMetadata())
    ->setCacheTags([
    'bar',
    'foo',
  ]);
  $initial_cacheability = (new CacheableMetadata())
    ->setCacheTags([
    'foo',
  ]);
  $this
    ->setVariationCacheItem($data, $cacheability, $initial_cacheability);
  $this
    ->assertVariationCacheItem($data, $cacheability, $initial_cacheability);
}