function MenuTestCase::resetMenuLink
Reset a standard menu link using the menu module UI.
Parameters
array $item Menu link.:
string $old_title Original title for menu link.:
1 call to MenuTestCase::resetMenuLink()
- MenuTestCase::testMenu in modules/
menu/ menu.test - Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.
File
-
modules/
menu/ menu.test, line 449
Class
- MenuTestCase
- @file Tests for menu.module.
Code
function resetMenuLink($item, $old_title) {
$mlid = $item['mlid'];
$title = $item['link_title'];
// Reset menu link.
$this->drupalPost("admin/structure/menu/item/{$mlid}/reset", array(), t('Reset'));
$this->assertResponse(200);
$this->assertRaw(t('The menu link was reset to its default settings.'), 'Menu link was reset');
// Verify menu link.
$this->drupalGet('');
$this->assertNoText($title, 'Menu link was reset');
$this->assertText($old_title, 'Menu link was reset');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.