// Check if menu weight is 17.
$this->
drupalGet('node/' .
$node->
id() . '/edit'
);
$this->
assertSession()->
fieldValueEquals('edit-menu-weight', 17
);
// Verify that the menu link title field has correct maxlength in node edit
// form.
$this->
assertSession()->
responseMatches('/<input .* id="edit-menu-title" .* maxlength="' .
$title_max_length . '" .* \/>/'
);
// Verify that the menu link description field has correct maxlength in
// node add form.
$this->
assertSession()->
responseMatches('/<input .* id="edit-menu-description" .* maxlength="' .
$description_max_length . '" .* \/>/'
);
// Disable the menu link, then edit the node--the link should stay disabled.
$link_id =
menu_ui_get_menu_link_defaults($node)['entity_id'
];
/** @var \Drupal\menu_link_content\Entity\MenuLinkContent $link */
$link = MenuLinkContent::
load($link_id);
$link->
set('enabled', FALSE
);
$link->
save();
$this->
drupalGet($node->
toUrl('edit-form'
));
$this->
submitForm($edit, 'Save'
);
$link = MenuLinkContent::
load($link_id);
$this->
assertFalse($link->
isEnabled(), 'Saving a node with a disabled menu link keeps the menu link disabled.'
);
// Edit the node and remove the menu link.
$edit =
[