You are here

public function ViewportPermissionsTest::testSettingsPageAccessPermission in Viewport 8

Tests that there's a permission to administer the viewport settings.

File

tests/src/Functional/ViewportPermissionsTest.php, line 48

Class

ViewportPermissionsTest
Tests the Viewport permissions exist.

Namespace

Drupal\Tests\viewport\Functional

Code

public function testSettingsPageAccessPermission() {
  $viewportSettingsPath = 'admin/appearance/settings/viewport';
  $this
    ->drupalLogin($this->userWithViewportPerm);
  $this
    ->drupalGet($viewportSettingsPath);
  $this
    ->assertEquals(200, $this
    ->getSession()
    ->getStatusCode());
  $this
    ->drupalLogin($this->userWithoutViewportPerm);
  $this
    ->drupalGet($viewportSettingsPath);
  $this
    ->assertEquals(403, $this
    ->getSession()
    ->getStatusCode());
}