You are here

protected function MigrateShortcutTest::assertEntity in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php \Drupal\Tests\shortcut\Kernel\Migrate\d7\MigrateShortcutTest::assertEntity()
  2. 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
Tests the shortcut migration.

File

core/modules/shortcut/tests/src/Kernel/Migrate/d7/MigrateShortcutTest.php, line 52

Class

MigrateShortcutTest
Test shortcut menu links migration to Shortcut entities.

Namespace

Drupal\Tests\shortcut\Kernel\Migrate\d7

Code

protected function assertEntity($id, $title, $weight, $url) {
  $shortcut = Shortcut::load($id);
  $this
    ->assertInstanceOf(ShortcutInterface::class, $shortcut);

  /** @var \Drupal\shortcut\ShortcutInterface $shortcut */
  $this
    ->assertSame($title, $shortcut
    ->getTitle());
  $this
    ->assertSame($weight, $shortcut
    ->getWeight());
  $this
    ->assertSame($url, $shortcut
    ->getUrl()
    ->toString());
}