function ShortcutSetsTest::testShortcutSetCreateWithSetName

Tests creating a new shortcut set with a defined set name.

File

drupal/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutSetsTest.php, line 160
Definition of Drupal\shortcut\Tests\ShortcutSetsTest.

Class

ShortcutSetsTest
Defines shortcut set test cases.

Namespace

Drupal\shortcut\Tests

Code

function testShortcutSetCreateWithSetName() {
  $random_name = $this
    ->randomName(10);
  $new_set = $this
    ->generateShortcutSet($random_name, TRUE, $random_name);
  $sets = shortcut_sets();
  $this
    ->assertTrue(isset($sets[$random_name]), 'Successfully created a shortcut set with a defined set name.');
  $this
    ->drupalGet('user/' . $this->admin_user->uid . '/shortcuts');
  $this
    ->assertText($new_set->title, 'Generated shortcut set was listed as a choice on the user account page.');
}