You are here

protected function MenuTreeStorageTest::addMenuLink in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php \Drupal\KernelTests\Core\Menu\MenuTreeStorageTest::addMenuLink()

Adds a link with the given ID and supply defaults.

7 calls to MenuTreeStorageTest::addMenuLink()
MenuTreeStorageTest::testLoadByProperties in core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
Tests MenuTreeStorage::loadByProperties().
MenuTreeStorageTest::testLoadTree in core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
Tests the loadTreeData method.
MenuTreeStorageTest::testMenuDisabledChildLinks in core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
Tests with disabled child links.
MenuTreeStorageTest::testMenuLinkMoving in core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
Tests the tree with moving links inside the hierarchy.
MenuTreeStorageTest::testMenuRebuild in core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php
Ensure hierarchy persists after a menu rebuild.

... See full list

File

core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php, line 369

Class

MenuTreeStorageTest
Tests the menu tree storage.

Namespace

Drupal\KernelTests\Core\Menu

Code

protected function addMenuLink($id, $parent = '', $route_name = 'test', $route_parameters = [], $menu_name = 'tools', $extra = []) {
  $link = [
    'id' => $id,
    'menu_name' => $menu_name,
    'route_name' => $route_name,
    'route_parameters' => $route_parameters,
    'title' => 'test',
    'parent' => $parent,
    'options' => [],
    'metadata' => [],
  ] + $extra;
  $this->treeStorage
    ->save($link);
}