You are here

public function ContentHubDeleteClientConfirmFormTest::testContentHubDeleteClientConfirmFormPagePermissions in Acquia Content Hub 8.2

Tests permissions of different users.

Throws

\Behat\Mink\Exception\ResponseTextException

\Behat\Mink\Exception\ExpectationException

File

tests/src/Functional/ContentHubDeleteClientConfirmFormTest.php, line 84

Class

ContentHubDeleteClientConfirmFormTest
Tests the Content Hub Delete Client confirmation form.

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

public function testContentHubDeleteClientConfirmFormPagePermissions() {
  $session = $this
    ->assertSession();
  $this
    ->drupalGet(self::CH_DELETE_CLIENT_CONFIRM_FORM_PATH);
  $session
    ->pageTextContains('Acquia Content Hub Delete Client Confirmation');
  $session
    ->statusCodeEquals(200);
  $this
    ->drupalLogout();
  $this
    ->drupalLogin($this->unauthorizedUser);
  $this
    ->drupalGet(self::CH_DELETE_CLIENT_CONFIRM_FORM_PATH);
  $session
    ->pageTextContains('Access denied');
  $session
    ->statusCodeEquals(403);
}