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. 10 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 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']);
}

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