You are here

public function MenuUiTest::testSystemMenuRename in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::testSystemMenuRename()

Tests renaming the built-in menu.

File

core/modules/menu_ui/tests/src/Functional/MenuUiTest.php, line 547

Class

MenuUiTest
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\Tests\menu_ui\Functional

Code

public function testSystemMenuRename() {
  $this
    ->drupalLogin($this->adminUser);
  $edit = [
    'label' => $this
      ->randomMachineName(16),
  ];
  $this
    ->drupalPostForm('admin/structure/menu/manage/main', $edit, t('Save'));

  // Make sure menu shows up with new name in block addition.
  $default_theme = $this
    ->config('system.theme')
    ->get('default');
  $this
    ->drupalget('admin/structure/block/list/' . $default_theme);
  $this
    ->clickLink('Place block');
  $this
    ->assertText($edit['label']);
}