function MigrateMenuTest::assertEntity

Same name in other branches
  1. 9 core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php \Drupal\Tests\system\Kernel\Migrate\d7\MigrateMenuTest::assertEntity()
  2. 8.9.x core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php \Drupal\Tests\system\Kernel\Migrate\d7\MigrateMenuTest::assertEntity()
  3. 11.x core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php \Drupal\Tests\system\Kernel\Migrate\d7\MigrateMenuTest::assertEntity()

Asserts various aspects of a menu.

@internal

Parameters

string $id: The menu ID.

string $language: The menu language.

$label: The menu label.

$description: The menu description.

1 call to MigrateMenuTest::assertEntity()
MigrateMenuTest::testMenu in core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php
Tests the Drupal 7 menu to Drupal 8 migration.

File

core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php, line 40

Class

MigrateMenuTest
Upgrade menus to system.menu.*.yml.

Namespace

Drupal\Tests\system\Kernel\Migrate\d7

Code

protected function assertEntity(string $id, string $language, string $label, string $description) : void {
    $navigation_menu = Menu::load($id);
    $this->assertSame($id, $navigation_menu->id());
    $this->assertSame($language, $navigation_menu->language()
        ->getId());
    $this->assertSame($label, $navigation_menu->label());
    $this->assertSame($description, $navigation_menu->getDescription());
}

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