You are here

protected function BlazyUnitTestTrait::getCacheMetaData in Blazy 8.2

Same name and namespace in other branches
  1. 8 tests/src/Traits/BlazyUnitTestTrait.php \Drupal\Tests\blazy\Traits\BlazyUnitTestTrait::getCacheMetaData()

Return dummy cache metadata.

1 call to BlazyUnitTestTrait::getCacheMetaData()
BlazyUnitTestTrait::doPreRenderImage in tests/src/Traits/BlazyUnitTestTrait.php
Pre render Blazy image.

File

tests/src/Traits/BlazyUnitTestTrait.php, line 183

Class

BlazyUnitTestTrait
A Trait common for Blazy Unit tests.

Namespace

Drupal\Tests\blazy\Traits

Code

protected function getCacheMetaData() {
  $build = [];
  $suffixes[] = 3;
  foreach ([
    'contexts',
    'keys',
    'tags',
  ] as $key) {
    if ($key == 'contexts') {
      $cache = [
        'languages',
      ];
    }
    elseif ($key == 'keys') {
      $cache = [
        'blazy_image',
      ];
    }
    elseif ($key == 'tags') {
      $cache = Cache::buildTags('file:123', $suffixes, '.');
    }
    $build['cache_' . $key] = $cache;
  }
  return $build;
}