You are here

protected function MenuAdminPerMenuNodeFormTest::setUp in Menu Admin per Menu 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/MenuAdminPerMenuNodeFormTest.php, line 74

Class

MenuAdminPerMenuNodeFormTest
Tests the interaction of the node system with menu links.

Namespace

Drupal\Tests\menu_admin_per_menu\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
    'display_submitted' => FALSE,
  ]);
  $this
    ->drupalCreateContentType([
    'type' => 'menu_test',
    'name' => 'Menu test',
    'display_submitted' => FALSE,
    'third_party_settings' => [
      'menu_ui' => [
        'available_menus' => [
          'menu_1',
          'menu_2',
          'menu_3',
        ],
      ],
    ],
  ]);
  $this
    ->drupalPlaceBlock('system_menu_block:main');
  $this->contentOnlyUser = $this
    ->drupalCreateUser([
    'access content',
    'administer content types',
  ]);
  $this->contentAndMenuUser = $this
    ->drupalCreateUser([
    'access content',
    'administer content types',
    'administer main menu items',
  ]);
  $this->menu1User = $this
    ->createUser([
    'access content',
    'administer content types',
    'administer menu_1 menu items',
  ], 'Menu 1 user');
  $this->menu2User = $this
    ->createUser([
    'access content',
    'administer content types',
    'administer menu_2 menu items',
  ], 'Menu 2 user');

  // Access to menu_3 is added in menu_admin_per_menu_hook_test.
  $this->menu3User = $this
    ->createUser([
    'access content',
    'administer content types',
  ], 'Menu 3 user');
}