You are here

public function ShortcutSetsTest::testShortcutSetRename in Drupal 8

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

Class

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

Namespace

Drupal\Tests\shortcut\Functional

Code

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