function MenuBlockTest::setUp

Same name in other branches
  1. 11.x core/modules/menu_ui/tests/src/Kernel/MenuBlockTest.php \Drupal\Tests\menu_ui\Kernel\MenuBlockTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/menu_ui/tests/src/Kernel/MenuBlockTest.php, line 42

Class

MenuBlockTest
Tests SystemMenuBlock.

Namespace

Drupal\Tests\menu_ui\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->installEntitySchema('user');
    $this->setUpCurrentUser([], [
        'administer menu',
    ]);
    // Add a new custom menu.
    $menu_name = 'mock';
    $label = $this->randomMachineName(16);
    $this->menu = Menu::create([
        'id' => $menu_name,
        'label' => $label,
        'description' => 'Description text',
    ]);
    $this->menu
        ->save();
}

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