You are here

public function ExtlinkAdminTest::testAdminAccess in External Links 8

Test access to the admin pages.

File

tests/src/FunctionalJavascript/ExtlinkAdminTest.php, line 19

Class

ExtlinkAdminTest
Testing of the External Links administration interface and functionality.

Namespace

Drupal\Tests\extlink\FunctionalJavascript

Code

public function testAdminAccess() {
  $this
    ->drupalLogin($this->normalUser);
  $this
    ->drupalGet(self::EXTLINK_ADMIN_PATH);
  $this
    ->assertSession()
    ->pageTextContains($this
    ->t('Access denied'), 'Normal users should not be able to access the External Links admin pages', 'External Links');
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet(self::EXTLINK_ADMIN_PATH);
  $this
    ->assertSession()
    ->pageTextNotContains($this
    ->t('Access denied'), 'Admin users should be able to access the External Links admin pages', 'External Links');
}