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