function MenuTestCase::deleteMenuLink

Delete a menu link using the menu module UI.

Parameters

array $item Menu link.:

1 call to MenuTestCase::deleteMenuLink()
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 469

Class

MenuTestCase
@file Tests for menu.module.

Code

function deleteMenuLink($item) {
    $mlid = $item['mlid'];
    $title = $item['link_title'];
    // Delete menu link.
    $this->drupalPost("admin/structure/menu/item/{$mlid}/delete", array(), t('Confirm'));
    $this->assertResponse(200);
    $this->assertRaw(t('The menu link %title has been deleted.', array(
        '%title' => $title,
    )), 'Menu link was deleted');
    // Verify deletion.
    $this->drupalGet('');
    $this->assertNoText($title, 'Menu link was deleted');
}

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