function MenuUiTest::deleteMenuLink
Same name in other branches
- 8.9.x core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::deleteMenuLink()
- 10 core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::deleteMenuLink()
- 11.x core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::deleteMenuLink()
Deletes a menu link using the UI.
Parameters
\Drupal\menu_link_content\Entity\MenuLinkContent $item: Menu link.
1 call to MenuUiTest::deleteMenuLink()
- MenuUiTest::testMenuAdministration in core/
modules/ menu_ui/ tests/ src/ Functional/ MenuUiTest.php - Tests menu functionality using the admin and user interfaces.
File
-
core/
modules/ menu_ui/ tests/ src/ Functional/ MenuUiTest.php, line 896
Class
- MenuUiTest
- Tests the menu UI.
Namespace
Drupal\Tests\menu_ui\FunctionalCode
public function deleteMenuLink(MenuLinkContent $item) {
$mlid = $item->id();
$title = $item->getTitle();
// Delete menu link.
$this->drupalGet("admin/structure/menu/item/{$mlid}/delete");
$this->submitForm([], 'Delete');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->pageTextContains("The menu link {$title} has been deleted.");
// Verify deletion.
$this->drupalGet('');
$this->assertSession()
->pageTextNotContains($title);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.