You are here

public function BlockManagerTest::testGroupedDefinitions in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testGroupedDefinitions()
  2. 10 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 94

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']));
}