function MenuTest::disableMenuLink

Disable a menu link.

Parameters

$item: Menu link.

2 calls to MenuTest::disableMenuLink()
MenuTest::doMenuTests in drupal/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
Tests menu functionality using the Tools menu.
MenuTest::toggleMenuLink in drupal/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
Alternately disable and enable a menu link.

File

drupal/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php, line 488
Definition of Drupal\menu\Tests\MenuTest.

Class

MenuTest

Namespace

Drupal\menu\Tests

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