You are here

public function LayoutPluginManagerTest::testGetThemeImplementations in Drupal 8

Same name and namespace in other branches
  1. 9 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 \Drupal\Core\Layout\LayoutPluginManager @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);
}