function ComponentRenderTest::checkLibraryOverrides

Same name in this branch
  1. 11.x core/modules/sdc/tests/src/Kernel/ComponentRenderTest.php \Drupal\Tests\sdc\Kernel\ComponentRenderTest::checkLibraryOverrides()
Same name and namespace in other branches
  1. 10 core/modules/sdc/tests/src/Kernel/ComponentRenderTest.php \Drupal\Tests\sdc\Kernel\ComponentRenderTest::checkLibraryOverrides()
  2. 10 core/tests/Drupal/KernelTests/Components/ComponentRenderTest.php \Drupal\KernelTests\Components\ComponentRenderTest::checkLibraryOverrides()

Check using the libraryOverrides.

1 call to ComponentRenderTest::checkLibraryOverrides()
ComponentRenderTest::testRender in core/tests/Drupal/KernelTests/Components/ComponentRenderTest.php
Test that components render correctly.

File

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

Class

ComponentRenderTest
Tests the correct rendering of components.

Namespace

Drupal\KernelTests\Components

Code

protected function checkLibraryOverrides() : 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.