You are here

public function ThemePreprocessTest::addsCacheTagToRenderArray in Image Lazyloader 8

Tests that cache tags are properly added to the render array.

@test

File

tests/src/Unit/ThemePreprocessTest.php, line 22

Class

ThemePreprocessTest
Tests preprocessing.

Namespace

Drupal\Tests\lazyloader\Unit

Code

public function addsCacheTagToRenderArray() {
  $sut = new ThemePreprocess($this
    ->createMock(ConfigFactoryInterface::class));
  $expected = [
    '#cache' => [
      'tags' => [
        0 => 'config:lazyloader.configuration',
      ],
    ],
  ];
  $this
    ->assertEquals($expected, $sut
    ->addCacheTags([]));
}