You are here

public function SystemMenuBlockTest::testSystemMenuBlockConfigDependencies in Zircon Profile 8

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

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

File

core/modules/system/src/Tests/Block/SystemMenuBlockTest.php, line 156
Contains \Drupal\system\Tests\Block\SystemMenuBlockTest.

Class

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

Namespace

Drupal\system\Tests\Block

Code

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