function MenuLinkTreeTest::setUp

Same name in this branch
  1. 8.9.x core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
Same name in other branches
  1. 9 core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
  3. 10 core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
  4. 10 core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
  5. 11.x core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
  6. 11.x core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php, line 50

Class

MenuLinkTreeTest
Tests the menu link tree.

Namespace

Drupal\KernelTests\Core\Menu

Code

protected function setUp() {
    parent::setUp();
    \Drupal::service('router.builder')->rebuild();
    $this->installEntitySchema('user');
    $this->installEntitySchema('menu_link_content');
    $this->linkTree = $this->container
        ->get('menu.link_tree');
    $this->menuLinkManager = $this->container
        ->get('plugin.manager.menu.link');
}

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