function MenuTest::disableMenuLink in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/menu_ui/src/Tests/MenuTest.php \Drupal\menu_ui\Tests\MenuTest::disableMenuLink()
Disables a menu link.
Parameters
\Drupal\menu_link_content\Entity\MenuLinkContent $item: Menu link.
2 calls to MenuTest::disableMenuLink()
- MenuTest::doMenuTests in core/
modules/ menu_ui/ src/ Tests/ MenuTest.php - Tests menu functionality.
- MenuTest::toggleMenuLink in core/
modules/ menu_ui/ src/ Tests/ MenuTest.php - Alternately disables and enables a menu link.
File
- core/
modules/ menu_ui/ src/ Tests/ MenuTest.php, line 841 - Contains \Drupal\menu_ui\Tests\MenuTest.
Class
- MenuTest
- Add a custom menu, add menu links to the custom menu and Tools menu, check their data, and delete them using the UI.
Namespace
Drupal\menu_ui\TestsCode
function disableMenuLink(MenuLinkContent $item) {
$mlid = $item
->id();
$edit['enabled[value]'] = FALSE;
$this
->drupalPostForm("admin/structure/menu/item/{$mlid}/edit", $edit, t('Save'));
// Unlike most other modules, there is no confirmation message displayed.
// Verify in the database.
$this
->assertMenuLink($item
->getPluginId(), array(
'enabled' => 0,
));
}