You are here

public function SystemMenuBlockTest::testSystemMenuBlockConfigDependencies in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php \Drupal\Tests\system\Kernel\Block\SystemMenuBlockTest::testSystemMenuBlockConfigDependencies()

Tests calculation of a system menu block's configuration dependencies.

File

core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php, line 155

Class

SystemMenuBlockTest
Tests \Drupal\system\Plugin\Block\SystemMenuBlock.

Namespace

Drupal\Tests\system\Kernel\Block

Code

public function testSystemMenuBlockConfigDependencies() {
  $block = Block::create([
    'plugin' => 'system_menu_block:' . $this->menu
      ->id(),
    'region' => 'footer',
    'id' => 'machinename',
    'theme' => 'stark',
  ]);
  $dependencies = $block
    ->calculateDependencies()
    ->getDependencies();
  $expected = [
    'config' => [
      'system.menu.' . $this->menu
        ->id(),
    ],
    'module' => [
      'system',
    ],
    'theme' => [
      'stark',
    ],
  ];
  $this
    ->assertIdentical($expected, $dependencies);
}