function MigrateShortcutSetUsersTest::testShortcutSetUsersMigration

Same name in other branches
  1. 9 core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php \Drupal\Tests\shortcut\Kernel\Migrate\d7\MigrateShortcutSetUsersTest::testShortcutSetUsersMigration()
  2. 8.9.x core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php \Drupal\Tests\shortcut\Kernel\Migrate\d7\MigrateShortcutSetUsersTest::testShortcutSetUsersMigration()
  3. 10 core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php \Drupal\Tests\shortcut\Kernel\Migrate\d7\MigrateShortcutSetUsersTest::testShortcutSetUsersMigration()

Tests the shortcut set migration.

File

core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php, line 45

Class

MigrateShortcutSetUsersTest
Test shortcut_set_users migration.

Namespace

Drupal\Tests\shortcut\Kernel\Migrate\d7

Code

public function testShortcutSetUsersMigration() : void {
    // Check if migrated user has correct migrated shortcut set assigned.
    $account = User::load(2);
    $shortcut_set_storage = \Drupal::entityTypeManager()->getStorage('shortcut_set');
    $shortcut_set = $shortcut_set_storage->getDisplayedToUser($account);
    
    /** @var \Drupal\shortcut\ShortcutSetInterface $shortcut_set */
    $this->assertSame('shortcut-set-2', $shortcut_set->id());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.