You are here

protected function SimpleMegaMenuTest::setUp in Simple Mega Menu 8

Same name and namespace in other branches
  1. 2.0.x src/Tests/SimpleMegaMenuTest.php \Drupal\simple_megamenu\Tests\SimpleMegaMenuTest::setUp()

Overrides BrowserTestBase::setUp

File

src/Tests/SimpleMegaMenuTest.php, line 68

Class

SimpleMegaMenuTest
Simple test to ensure that main page loads with module enabled.

Namespace

Drupal\simple_megamenu\Tests

Code

protected function setUp() {
  parent::setUp();
  $this->normalUser = $this
    ->drupalCreateUser([
    'view published simple mega menu entities',
  ]);
  $this->user = $this
    ->drupalCreateUser([
    'administer site configuration',
    'administer menu',
    'administer blocks',
    'access simple mega menu entities canonical page',
    'view published simple mega menu entities',
    'view unpublished simple mega menu entities',
    'add simple mega menu entities',
    'edit simple mega menu entities',
    'access simple mega menu overview',
  ]);
  $this
    ->drupalLogin($this->user);

  // Set the mmain menu block to an unlimited level.
  $block_main_menu_path = '/admin/structure/block/manage/stark_main_menu';
  $edit = [
    'settings[depth]' => '0',
  ];
  $this
    ->drupalPostForm($block_main_menu_path, $edit, 'Save block');
}