You are here

protected function PermissionsTest::setUp in Menu Item Role Access 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/PermissionsTest.php \Drupal\Tests\menu_item_role_access\Functional\PermissionsTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/PermissionsTest.php, line 60

Class

PermissionsTest
Tests handling of menu links hierarchies.

Namespace

Drupal\Tests\menu_item_role_access\Functional

Code

protected function setUp() {
  parent::setUp();
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer menu',
    'edit menu_item_role_access',
  ]);
  $this->noAccessUser = $this
    ->drupalCreateUser([
    'administer menu',
  ]);
  $this
    ->drupalLogin($this->adminUser);
  $this->menuLinkManager = \Drupal::service('plugin.manager.menu.link');
  $this->menuName = 'menu_test';
  Menu::create([
    'id' => $this->menuName,
    'label' => 'Test menu',
    'description' => 'Description text',
  ])
    ->save();
}