function ShortcutSetsTest::testShortcutSetUnassign

Tests unassigning a shortcut set.

File

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

Class

ShortcutSetsTest
Defines shortcut set test cases.

Namespace

Drupal\shortcut\Tests

Code

function testShortcutSetUnassign() {
  $new_set = $this
    ->generateShortcutSet($this
    ->randomName());
  shortcut_set_assign_user($new_set, $this->shortcut_user);
  shortcut_set_unassign_user($this->shortcut_user);
  $current_set = shortcut_current_displayed_set($this->shortcut_user);
  $default_set = shortcut_default_set($this->shortcut_user);
  $this
    ->assertTrue($current_set
    ->id() == $default_set
    ->id(), "Successfully unassigned another user's shortcut set.");
}