You are here

protected function MenuTreeStorageTest::moveMenuLink 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::moveMenuLink()

Moves the link with the given ID so it's under a new parent.

Parameters

string $id: The ID of the menu link to move.

string $new_parent: The ID of the new parent link.

2 calls to MenuTreeStorageTest::moveMenuLink()
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.

File

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

Class

MenuTreeStorageTest
Tests the menu tree storage.

Namespace

Drupal\system\Tests\Menu

Code

protected function moveMenuLink($id, $new_parent) {
  $menu_link = $this->treeStorage
    ->load($id);
  $menu_link['parent'] = $new_parent;
  $this->treeStorage
    ->save($menu_link);
}