$links =
[ 1 => MenuLinkMock::
create(['id' => 'test.example1', 'route_name' => 'example1', 'title' => 'foo', 'parent' => '', 'weight' => 0
]),
2 => MenuLinkMock::
create(['id' => 'test.example2', 'route_name' => 'example2', 'title' => 'bar', 'parent' => '', 'route_parameters' =>
['foo' => 'bar'
], 'weight' => 1
]),
3 => MenuLinkMock::
create(['id' => 'test.example3', 'route_name' => 'example3', 'title' => 'baz', 'parent' => 'test.example2', 'weight' => 2
]),
4 => MenuLinkMock::
create(['id' => 'test.example4', 'route_name' => 'example4', 'title' => 'qux', 'parent' => 'test.example3', 'weight' => 3
]),
5 => MenuLinkMock::
create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'foofoo', 'parent' => '', 'expanded' => TRUE, 'weight' => 4
]),
6 => MenuLinkMock::
create(['id' => 'test.example6', 'route_name' => '', 'url' => 'https://www.drupal.org/', 'title' => 'barbar', 'parent' => '', 'weight' => 5
]),
7 => MenuLinkMock::
create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'bazbaz', 'parent' => 'test.example5', 'weight' => 6
]),
8 => MenuLinkMock::
create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'quxqux', 'parent' => '', 'weight' => 7
]),
];
foreach ($links as $instance) { $this->menuLinkManager->
addDefinition($instance->
getPluginId(),
$instance->
getPluginDefinition());
} } /**
* Tests calculation of a system menu block's configuration dependencies.
*/
public function testSystemMenuBlockConfigDependencies() { $block = Block::
create([ 'plugin' => 'system_menu_block:' .
$this->menu->
id(),
'region' => 'footer',