function ShortcutSetsTest::testShortcutSetRename

Same name and namespace in other branches
  1. 9 core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetRename()
  2. 8.9.x core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetRename()
  3. 11.x core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php \Drupal\Tests\shortcut\Functional\ShortcutSetsTest::testShortcutSetRename()

Tests renaming a shortcut set.

File

core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php, line 168

Class

ShortcutSetsTest
Create, view, edit, delete, and change shortcut sets.

Namespace

Drupal\Tests\shortcut\Functional

Code

public function testShortcutSetRename() : void {
  $set = $this->set;
  $new_label = $this->randomMachineName();
  $this->drupalGet('admin/config/user-interface/shortcut');
  $this->clickLink('Edit shortcut set');
  $this->submitForm([
    'label' => $new_label,
  ], 'Save');
  $set = ShortcutSet::load($set->id());
  $this->assertSame($new_label, $set->label(), 'Shortcut set has been successfully renamed.');
}

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