protected function MenuTreeStorageTest::moveMenuLink in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php \Drupal\KernelTests\Core\Menu\MenuTreeStorageTest::moveMenuLink()
- 10 core/tests/Drupal/KernelTests/Core/Menu/MenuTreeStorageTest.php \Drupal\KernelTests\Core\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/
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 398
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);
}