function MenuTestCase::deleteMenuLink

7.x menu.test MenuTestCase::deleteMenuLink($item)

Delete a menu link using the menu module UI.

Parameters

array $item Menu link.:

1 call to MenuTestCase::deleteMenuLink()
MenuTestCase::testMenu in drupal-7.x/modules/menu/menu.test
Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.

File

drupal-7.x/modules/menu/menu.test, line 428
Tests for menu.module.

Class

MenuTestCase

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