You are here

function MenuTest::enableMenuLink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/menu_ui/src/Tests/MenuTest.php \Drupal\menu_ui\Tests\MenuTest::enableMenuLink()

Enables a menu link.

Parameters

\Drupal\menu_link_content\Entity\MenuLinkContent $item: Menu link.

1 call to MenuTest::enableMenuLink()
MenuTest::toggleMenuLink in core/modules/menu_ui/src/Tests/MenuTest.php
Alternately disables and enables a menu link.

File

core/modules/menu_ui/src/Tests/MenuTest.php, line 857
Contains \Drupal\menu_ui\Tests\MenuTest.

Class

MenuTest
Add a custom menu, add menu links to the custom menu and Tools menu, check their data, and delete them using the UI.

Namespace

Drupal\menu_ui\Tests

Code

function enableMenuLink(MenuLinkContent $item) {
  $mlid = $item
    ->id();
  $edit['enabled[value]'] = TRUE;
  $this
    ->drupalPostForm("admin/structure/menu/item/{$mlid}/edit", $edit, t('Save'));

  // Verify in the database.
  $this
    ->assertMenuLink($item
    ->getPluginId(), array(
    'enabled' => 1,
  ));
}