protected function BlazyUnitTestTrait::getCacheMetaData in Blazy 8
Same name and namespace in other branches
- 8.2 tests/src/Traits/BlazyUnitTestTrait.php \Drupal\Tests\blazy\Traits\BlazyUnitTestTrait::getCacheMetaData()
Return dummy cache metadata.
2 calls to BlazyUnitTestTrait::getCacheMetaData()
- BlazyManagerUnitTest::testPreRenderImage in tests/
src/ Unit/ BlazyManagerUnitTest.php - Tests for \Drupal\blazy\BlazyManager::preRenderImage().
- BlazyUnitTestTrait::doPreRenderImage in tests/
src/ Traits/ BlazyUnitTestTrait.php - Pre render Blazy image.
File
- tests/
src/ Traits/ BlazyUnitTestTrait.php, line 215
Class
- BlazyUnitTestTrait
- A Trait common for Blazy Unit tests.
Namespace
Drupal\Tests\blazy\TraitsCode
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;
}