function MenuTest::toggleMenuLink

Alternately disable and enable a menu link.

Parameters

$item: Menu link.

1 call to MenuTest::toggleMenuLink()
MenuTest::doMenuTests in drupal/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
Tests menu functionality.

File

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

Class

MenuTest

Namespace

Drupal\menu\Tests

Code

function toggleMenuLink($item) {
  $this
    ->disableMenuLink($item);

  // Verify menu link is absent.
  $this
    ->drupalGet('');
  $this
    ->assertNoText($item['link_title'], 'Menu link was not displayed');
  $this
    ->enableMenuLink($item);

  // Verify menu link is displayed.
  $this
    ->drupalGet('');
  $this
    ->assertText($item['link_title'], 'Menu link was displayed');
}