function MenuUiTest::testSystemMenuRename

Same name in other branches
  1. 9 core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::testSystemMenuRename()
  2. 8.9.x core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::testSystemMenuRename()
  3. 11.x 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 690

Class

MenuUiTest
Tests the menu UI.

Namespace

Drupal\Tests\menu_ui\Functional

Code

public function testSystemMenuRename() : void {
    $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']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.