function NavigationMenuBlockTest::testSystemMenuBlockConfigDependencies

Same name in other branches
  1. 10 core/modules/navigation/tests/src/Kernel/NavigationMenuBlockTest.php \Drupal\Tests\navigation\Kernel\NavigationMenuBlockTest::testSystemMenuBlockConfigDependencies()

Tests calculation of a system navigation menu block's config dependencies.

File

core/modules/navigation/tests/src/Kernel/NavigationMenuBlockTest.php, line 181

Class

NavigationMenuBlockTest
Tests \Drupal\navigation\Plugin\Block\NavigationMenuBlock.

Namespace

Drupal\Tests\navigation\Kernel

Code

public function testSystemMenuBlockConfigDependencies() : void {
    $block = Block::create([
        'plugin' => 'navigation_menu:' . $this->menu
            ->id(),
        'region' => 'content',
        'id' => 'machine_name',
        'theme' => 'stark',
    ]);
    $dependencies = $block->calculateDependencies()
        ->getDependencies();
    $expected = [
        'config' => [
            'system.menu.' . $this->menu
                ->id(),
        ],
        'module' => [
            'navigation',
            'system',
        ],
        'theme' => [
            'stark',
        ],
    ];
    $this->assertSame($expected, $dependencies);
}

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