function LayoutPluginManagerTest::testGetThemeImplementations

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutPluginManagerTest::testGetThemeImplementations()
  2. 8.9.x core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutPluginManagerTest::testGetThemeImplementations()
  3. 11.x core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutPluginManagerTest::testGetThemeImplementations()

@covers ::getThemeImplementations

File

core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php, line 278

Class

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

Namespace

Drupal\Tests\Core\Layout

Code

public function testGetThemeImplementations() : void {
    $core_path = '/core/lib/Drupal/Core';
    $expected = [
        'layout' => [
            'render element' => 'content',
        ],
        'twocol' => [
            'render element' => 'content',
            'base hook' => 'layout',
            'template' => 'twocol',
            'path' => 'themes/theme_a/templates',
        ],
        'plugin_provided_layout' => [
            'render element' => 'content',
            'base hook' => 'layout',
            'template' => 'plugin-provided-layout',
            'path' => "{$core_path}/templates",
        ],
        'plugin_provided_annotation_layout' => [
            'render element' => 'content',
            'base hook' => 'layout',
            'template' => 'plugin-provided-annotation-layout',
            'path' => "{$core_path}/templates",
        ],
    ];
    $theme_implementations = $this->layoutPluginManager
        ->getThemeImplementations();
    $this->assertEquals($expected, $theme_implementations);
}

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