You are here

public function BlockManagerTest::testGroupedDefinitions in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testGroupedDefinitions()
  2. 9 core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testGroupedDefinitions()

@covers ::getGroupedDefinitions

File

core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php, line 101

Class

BlockManagerTest
@coversDefaultClass \Drupal\Core\Block\BlockManager

Namespace

Drupal\Tests\Core\Block

Code

public function testGroupedDefinitions() {
  $definitions = $this->blockManager
    ->getGroupedDefinitions();
  $this
    ->assertSame([
    'Group 1',
    'Group 2',
  ], array_keys($definitions));
  $this
    ->assertSame([
    'block2',
  ], array_keys($definitions['Group 1']));
  $this
    ->assertSame([
    'block3',
    'block1',
  ], array_keys($definitions['Group 2']));
}