function MenuLinksTest::setUp

Same name in other branches
  1. 9 core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php \Drupal\Tests\menu_link_content\Kernel\MenuLinksTest::setUp()
  2. 10 core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php \Drupal\Tests\menu_link_content\Kernel\MenuLinksTest::setUp()
  3. 11.x core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php \Drupal\Tests\menu_link_content\Kernel\MenuLinksTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php, line 42

Class

MenuLinksTest
Tests handling of menu links hierarchies.

Namespace

Drupal\Tests\menu_link_content\Kernel

Code

protected function setUp() {
    parent::setUp();
    $this->menuLinkManager = \Drupal::service('plugin.manager.menu.link');
    $this->installSchema('system', [
        'sequences',
    ]);
    $this->installSchema('user', [
        'users_data',
    ]);
    $this->installEntitySchema('entity_test_external');
    $this->installEntitySchema('menu_link_content');
    $this->installEntitySchema('user');
    Menu::create([
        'id' => 'menu_test',
        'label' => 'Test menu',
        'description' => 'Description text',
    ])->save();
}

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