You are here

class ThemePreprocessTest in Image Lazyloader 8

Tests preprocessing.

@coversDefaultClass \Drupal\lazyloader\ThemePreprocess @group lazyloader

Hierarchy

Expanded class hierarchy of ThemePreprocessTest

File

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

Namespace

Drupal\Tests\lazyloader\Unit
View source
class ThemePreprocessTest extends TestCase {

  /**
   * Tests that cache tags are properly added to the render array.
   *
   * @test
   */
  public function addsCacheTagToRenderArray() {
    $sut = new ThemePreprocess($this
      ->createMock(ConfigFactoryInterface::class));
    $expected = [
      '#cache' => [
        'tags' => [
          0 => 'config:lazyloader.configuration',
        ],
      ],
    ];
    $this
      ->assertEquals($expected, $sut
      ->addCacheTags([]));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ThemePreprocessTest::addsCacheTagToRenderArray public function Tests that cache tags are properly added to the render array.