You are here

protected function ImageFormatterTest::assertCacheTags in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/image/tests/src/Kernel/ImageFormatterTest.php \Drupal\Tests\image\Kernel\ImageFormatterTest::assertCacheTags()

Asserts that a renderable array has a set of cache tags.

Parameters

array $renderable: The renderable array. Must have a #cache[tags] element.

array $cache_tags: The expected cache tags.

1 call to ImageFormatterTest::assertCacheTags()
ImageFormatterTest::testImageFormatterSvg in core/modules/image/tests/src/Kernel/ImageFormatterTest.php
Tests ImageFormatter's handling of SVG images.

File

core/modules/image/tests/src/Kernel/ImageFormatterTest.php, line 210

Class

ImageFormatterTest
Tests the image field rendering using entity fields of the image field type.

Namespace

Drupal\Tests\image\Kernel

Code

protected function assertCacheTags(array $renderable, array $cache_tags) {
  $diff = array_diff($cache_tags, $renderable['#cache']['tags']);
  $this
    ->assertEmpty($diff);
}