You are here

protected function MenuPerRoleFunctionalTestBase::createMenu in Menu Per Role 8

Helper method to create a Drupal menu.

Parameters

string $menuId: The menu machine name.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to MenuPerRoleFunctionalTestBase::createMenu()
MenuPerRoleFunctionalTestBase::setUp in tests/src/Functional/MenuPerRoleFunctionalTestBase.php

File

tests/src/Functional/MenuPerRoleFunctionalTestBase.php, line 69

Class

MenuPerRoleFunctionalTestBase
Base class for Menu Per Role tests.

Namespace

Drupal\Tests\menu_per_role\Functional

Code

protected function createMenu(string $menuId) : void {
  $menu = Menu::create([
    'id' => $menuId,
    'label' => $this
      ->randomMachineName(16),
  ]);
  $menu
    ->save();
}