You are here

public function LayoutPluginManagerTest::testGetDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Layout/LayoutPluginManagerTest.php \Drupal\Tests\Core\Layout\LayoutPluginManagerTest::testGetDefinitions()

@covers ::getDefinitions @covers ::providerExists

File

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

Class

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

Namespace

Drupal\Tests\Core\Layout

Code

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