function LayoutPluginManagerTest::testPluginOverride

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Layout/LayoutPluginManagerTest.php \Drupal\KernelTests\Core\Layout\LayoutPluginManagerTest::testPluginOverride()

Tests that layout plugins are correctly overridden.

File

core/tests/Drupal/KernelTests/Core/Layout/LayoutPluginManagerTest.php, line 34

Class

LayoutPluginManagerTest
@coversDefaultClass \Drupal\Core\Layout\LayoutPluginManager @group Layout

Namespace

Drupal\KernelTests\Core\Layout

Code

public function testPluginOverride() : void {
    
    /** @var \Drupal\Core\Layout\LayoutPluginManagerInterface $layouts_manager */
    $layouts_manager = $this->container
        ->get('plugin.manager.core.layout');
    $definitions = $layouts_manager->getDefinitions();
    $this->assertInstanceOf(LayoutDefinition::class, $definitions['theme_parent_provided_layout']);
    $this->assertSame('Child', $definitions['theme_parent_provided_layout']->getLabel()
        ->render());
}

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