function 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/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.
File
- 
              core/tests/ Drupal/ KernelTests/ Core/ Menu/ MenuTreeStorageTest.php, line 402 
Class
- MenuTreeStorageTest
- Tests the menu tree storage.
Namespace
Drupal\KernelTests\Core\MenuCode
protected function moveMenuLink($id, $new_parent) {
  $menu_link = $this->treeStorage
    ->load($id);
  $menu_link['parent'] = $new_parent;
  $this->treeStorage
    ->save($menu_link);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
