function ShortcutSetsTest::testShortcutSetAdd

Tests creating a shortcut set.

File

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

Class

ShortcutSetsTest
Defines shortcut set test cases.

Namespace

Drupal\shortcut\Tests

Code

function testShortcutSetAdd() {
  $new_set = $this
    ->generateShortcutSet($this
    ->randomName());
  $sets = entity_load_multiple('shortcut');
  $this
    ->assertTrue(isset($sets[$new_set
    ->id()]), 'Successfully created a shortcut set.');
  $this
    ->drupalGet('user/' . $this->admin_user->uid . '/shortcuts');
  $this
    ->assertText($new_set
    ->label(), 'Generated shortcut set was listed as a choice on the user account page.');
}