You are here

public function MenuExportConfigurationFormTest::testFormLoad in Menu Import and Export 8

File

tests/src/Functional/MenuExportConfigurationFormTest.php, line 15

Class

MenuExportConfigurationFormTest
. @group menu_export

Namespace

Drupal\Tests\menu_export\Functional\Form

Code

public function testFormLoad() {
  $user = $this
    ->drupalCreateUser();
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet("/admin/config/development/menu_export");
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet("/admin/config/development/menu_export/import");
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $this
    ->drupalGet("/admin/config/development/menu_export/export");
  $this
    ->assertSession()
    ->statusCodeEquals(403);
  $user = $this
    ->drupalCreateUser([
    'export and import menu links',
  ]);
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet("/admin/config/development/menu_export");
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet("/admin/config/development/menu_export/import");
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet("/admin/config/development/menu_export/export");
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}