You are here

public function DomainConfigUIPermissionsTest::testSettingsAccess in Domain Access 8

Tests access the the settings form.

File

domain_config_ui/tests/src/Functional/DomainConfigUIPermissionsTest.php, line 41

Class

DomainConfigUIPermissionsTest
Tests the domain config user interface.

Namespace

Drupal\Tests\domain_config_ui\Functional

Code

public function testSettingsAccess() {
  $this
    ->drupalLogin($this->adminUser);
  $path = '/admin/config/domain/config-ui';
  $path2 = '/admin/config/system/site-information';

  // Visit the domain config ui administration page.
  $this
    ->drupalGet($path);
  $this
    ->assertResponse(200);

  // Visit the site information page.
  $this
    ->drupalGet($path2);
  $this
    ->assertResponse(200);
  $this
    ->findField('domain');
  $this
    ->drupalLogin($this->editorUser);

  // Visit the domain config ui administration page.
  $this
    ->drupalGet($path);
  $this
    ->assertResponse(403);

  // Visit the site information page.
  $this
    ->drupalGet($path2);
  $this
    ->assertResponse(200);
  $this
    ->findNoField('domain');
}