protected function MigrateMenuLinkTest::assertEntity in Drupal 10
Same name and namespace in other branches
- 8 core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php \Drupal\Tests\menu_link_content\Kernel\Migrate\d6\MigrateMenuLinkTest::assertEntity()
- 9 core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTest.php \Drupal\Tests\menu_link_content\Kernel\Migrate\d6\MigrateMenuLinkTest::assertEntity()
Asserts various aspects of a menu link entity.
@internal
Parameters
string $id: The link ID.
string $title: The expected title of the link.
string $menu: The expected ID of the menu to which the link will belong.
string|null $description: The link's expected description.
bool $enabled: Whether the link is enabled.
bool $expanded: Whether the link is expanded.
array $attributes: Additional attributes the link is expected to have.
string $uri: The expected URI of the link.
int $weight: The expected weight of the link.
1 call to MigrateMenuLinkTest::assertEntity()
- MigrateMenuLinkTest::testMenuLinks in core/
modules/ menu_link_content/ tests/ src/ Kernel/ Migrate/ d6/ MigrateMenuLinkTest.php - Tests migration of menu links.
File
- core/
modules/ menu_link_content/ tests/ src/ Kernel/ Migrate/ d6/ MigrateMenuLinkTest.php, line 71
Class
- MigrateMenuLinkTest
- Menu link migration.
Namespace
Drupal\Tests\menu_link_content\Kernel\Migrate\d6Code
protected function assertEntity(string $id, string $title, string $menu, ?string $description, bool $enabled, bool $expanded, array $attributes, string $uri, int $weight) : void {
/** @var \Drupal\menu_link_content\MenuLinkContentInterface $menu_link */
$menu_link = MenuLinkContent::load($id);
$this
->assertInstanceOf(MenuLinkContentInterface::class, $menu_link);
$this
->assertSame($title, $menu_link
->getTitle());
$this
->assertSame($menu, $menu_link
->getMenuName());
$this
->assertSame($description, $menu_link
->getDescription());
$this
->assertSame($enabled, $menu_link
->isEnabled());
$this
->assertSame($expanded, $menu_link
->isExpanded());
$this
->assertSame($attributes, $menu_link->link->options);
$this
->assertSame($uri, $menu_link->link->uri);
$this
->assertSame($weight, $menu_link
->getWeight());
}