function MenuTestCase::disableMenuLink in Drupal 7
Disable a menu link.
Parameters
$item: Menu link.
2 calls to MenuTestCase::disableMenuLink()
- MenuTestCase::doMenuTests in modules/
menu/ menu.test - Test menu functionality using navigation menu.
- MenuTestCase::toggleMenuLink in modules/
menu/ menu.test - Alternately disable and enable a menu link.
File
- modules/
menu/ menu.test, line 508 - Tests for menu.module.
Class
- MenuTestCase
- @file Tests for menu.module.
Code
function disableMenuLink($item) {
$mlid = $item['mlid'];
$edit['enabled'] = FALSE;
$this
->drupalPost("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($mlid, array(
'hidden' => 1,
));
}