function LayoutPluginManagerTest::testGetThemeImplementations

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutPluginManagerTest::testGetThemeImplementations()
  2. 10 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 225

Class

LayoutPluginManagerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Layout%21LayoutPluginManager.php/class/LayoutPluginManager/8.9.x" title="Provides a plugin manager for layouts." class="local">\Drupal\Core\Layout\LayoutPluginManager</a> @group Layout

Namespace

Drupal\Tests\Core\Layout

Code

public function testGetThemeImplementations() {
    $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",
        ],
    ];
    $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.