function MenuTestCase::toggleMenuLink
Alternately disable and enable a menu link.
Parameters
$item: Menu link.
1 call to MenuTestCase::toggleMenuLink()
- MenuTestCase::doMenuTests in modules/
menu/ menu.test - Test menu functionality using navigation menu.
File
-
modules/
menu/ menu.test, line 489
Class
- MenuTestCase
- @file Tests for menu.module.
Code
function toggleMenuLink($item) {
$this->disableMenuLink($item);
// Verify menu link is absent.
$this->drupalGet('');
$this->assertNoText($item['link_title'], 'Menu link was not displayed');
$this->enableMenuLink($item);
// Verify menu link is displayed.
$this->drupalGet('');
$this->assertText($item['link_title'], 'Menu link was displayed');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.