function ComponentRenderTest::testRenderLibraryOverrides

Check using the libraryOverrides.

File

core/tests/Drupal/KernelTests/Components/ComponentRenderTest.php, line 115

Class

ComponentRenderTest
Tests the correct rendering of components.

Namespace

Drupal\KernelTests\Components

Code

public function testRenderLibraryOverrides() : void {
  $build = [
    '#type' => 'inline_template',
    '#template' => "{{ include('sdc_theme_test:lib-overrides') }}",
  ];
  $metadata = new BubbleableMetadata();
  $this->renderComponentRenderArray($build, $metadata);
  $this->assertEquals([
    'core/components.sdc_theme_test--lib-overrides',
  ], $metadata->getAttachments()['library']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.