protected function MigrateShortcutTest::assertEntity in Drupal 8
Same name and namespace in other branches
- 9 core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php \Drupal\Tests\shortcut\Kernel\Migrate\d7\MigrateShortcutTest::assertEntity()
- 10 core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php \Drupal\Tests\shortcut\Kernel\Migrate\d7\MigrateShortcutTest::assertEntity()
Asserts various aspects of a shortcut entity.
Parameters
int $id: The shortcut ID.
string $title: The expected title of the shortcut.
int $weight: The expected weight of the shortcut.
string $url: The expected URL of the shortcut.
1 call to MigrateShortcutTest::assertEntity()
- MigrateShortcutTest::testShortcutMigration in core/
modules/ shortcut/ tests/ src/ Kernel/ Migrate/ d7/ MigrateShortcutTest.php - Test the shortcut migration.
File
- core/
modules/ shortcut/ tests/ src/ Kernel/ Migrate/ d7/ MigrateShortcutTest.php, line 54
Class
- MigrateShortcutTest
- Test shortcut menu links migration to Shortcut entities.
Namespace
Drupal\Tests\shortcut\Kernel\Migrate\d7Code
protected function assertEntity($id, $title, $weight, $url) {
$shortcut = Shortcut::load($id);
$this
->assertInstanceOf(ShortcutInterface::class, $shortcut);
/** @var \Drupal\shortcut\ShortcutInterface $shortcut */
$this
->assertIdentical($title, $shortcut
->getTitle());
$this
->assertIdentical($weight, $shortcut
->getWeight());
$this
->assertIdentical($url, $shortcut
->getUrl()
->toString());
}