You are here

function ShortcutSetsTest::testShortcutSetAssign in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/shortcut/src/Tests/ShortcutSetsTest.php \Drupal\shortcut\Tests\ShortcutSetsTest::testShortcutSetAssign()

Tests switching another user's shortcut set.

File

core/modules/shortcut/src/Tests/ShortcutSetsTest.php, line 122
Contains \Drupal\shortcut\Tests\ShortcutSetsTest.

Class

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

Namespace

Drupal\shortcut\Tests

Code

function testShortcutSetAssign() {
  $new_set = $this
    ->generateShortcutSet($this
    ->randomMachineName());
  \Drupal::entityManager()
    ->getStorage('shortcut_set')
    ->assignUser($new_set, $this->shortcutUser);
  $current_set = shortcut_current_displayed_set($this->shortcutUser);
  $this
    ->assertTrue($new_set
    ->id() == $current_set
    ->id(), "Successfully switched another user's shortcut set.");
}