function BlockManagerTest::testGroupedDefinitions

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testGroupedDefinitions()
  2. 8.9.x core/tests/Drupal/Tests/Core/Block/BlockManagerTest.php \Drupal\Tests\Core\Block\BlockManagerTest::testGroupedDefinitions()
  3. 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 106

Class

BlockManagerTest
@coversDefaultClass \Drupal\Core\Block\BlockManager

Namespace

Drupal\Tests\Core\Block

Code

public function testGroupedDefinitions() : void {
    $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']));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.