You are here

public function LayoutPluginManagerTest::testGetSortedDefinitions 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::testGetSortedDefinitions()

@covers ::getSortedDefinitions

File

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

Class

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

Namespace

Drupal\Tests\Core\Layout

Code

public function testGetSortedDefinitions() {
  $expected = [
    'module_a_provided_layout',
    'plugin_provided_layout',
    'theme_a_provided_layout',
  ];
  $layout_definitions = $this->layoutPluginManager
    ->getSortedDefinitions();
  $this
    ->assertEquals($expected, array_keys($layout_definitions));
  $this
    ->assertContainsOnlyInstancesOf(LayoutDefinition::class, $layout_definitions);
}