MigrateShortcutSetUsersTest.php in Drupal 9
File
core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutSetUsersTest.php
View source
<?php
namespace Drupal\Tests\shortcut\Kernel\Migrate\d7;
use Drupal\user\Entity\User;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
class MigrateShortcutSetUsersTest extends MigrateDrupal7TestBase {
protected static $modules = [
'link',
'field',
'shortcut',
'menu_link_content',
];
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('shortcut');
$this
->installEntitySchema('menu_link_content');
$this
->installSchema('shortcut', [
'shortcut_set_users',
]);
$this
->migrateUsers(FALSE);
$this
->executeMigration('d7_shortcut_set');
$this
->executeMigration('d7_menu');
$this
->executeMigration('d7_shortcut');
$this
->executeMigration('d7_shortcut_set_users');
}
public function testShortcutSetUsersMigration() {
$account = User::load(2);
$shortcut_set = shortcut_current_displayed_set($account);
$this
->assertSame('shortcut_set_2', $shortcut_set
->id());
}
}