You are here

protected function MenuTreeStorageTest::addMenuLink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php \Drupal\system\Tests\Menu\MenuTreeStorageTest::addMenuLink()

Adds a link with the given ID and supply defaults.

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

... See full list

File

core/modules/system/src/Tests/Menu/MenuTreeStorageTest.php, line 382
Contains \Drupal\system\Tests\Menu\MenuTreeStorageTest.

Class

MenuTreeStorageTest
Tests the menu tree storage.

Namespace

Drupal\system\Tests\Menu

Code

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