You are here

public function MenuUiTest::testSystemMenuRename in Drupal 9

Same name and namespace in other branches
  1. 8 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 571

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
    ->drupalGet('admin/structure/menu/manage/main');
  $this
    ->submitForm($edit, '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
    ->assertSession()
    ->pageTextContains($edit['label']);
}