function MenuTestCase::disableMenuLink

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

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,
    ));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.