function MenuTest::resetMenuLink

Reset a standard menu link using the menu module UI.

Parameters

array $item Menu link.:

string $old_title Original title for menu link.:

1 call to MenuTest::resetMenuLink()
MenuTest::testMenu in drupal/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.

File

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

Class

MenuTest

Namespace

Drupal\menu\Tests

Code

function resetMenuLink($item, $old_title) {
  $mlid = $item['mlid'];
  $title = $item['link_title'];

  // Reset menu link.
  $this
    ->drupalPost("admin/structure/menu/item/{$mlid}/reset", array(), t('Reset'));
  $this
    ->assertResponse(200);
  $this
    ->assertRaw(t('The menu link was reset to its default settings.'), 'Menu link was reset');

  // Verify menu link.
  $this
    ->drupalGet('');
  $this
    ->assertNoText($title, 'Menu link was reset');
  $this
    ->assertText($old_title, 'Menu link was reset');
}