DomainConfigUIPermissionsTest.php in Domain Access 8
File
domain_config_ui/tests/src/Functional/DomainConfigUIPermissionsTest.php
View source
<?php
namespace Drupal\Tests\domain_config_ui\Functional;
use Drupal\Tests\domain_config\Functional\DomainConfigTestBase;
use Drupal\Tests\domain_config_ui\Traits\DomainConfigUITestTrait;
class DomainConfigUIPermissionsTest extends DomainConfigTestBase {
use DomainConfigUITestTrait;
public static $modules = [
'domain_config_ui',
];
public function setUp() {
parent::setUp();
$this
->createAdminUser();
$this
->createEditorUser();
$this
->domainCreateTestDomains(5);
}
public function testSettingsAccess() {
$this
->drupalLogin($this->adminUser);
$path = '/admin/config/domain/config-ui';
$path2 = '/admin/config/system/site-information';
$this
->drupalGet($path);
$this
->assertResponse(200);
$this
->drupalGet($path2);
$this
->assertResponse(200);
$this
->findField('domain');
$this
->drupalLogin($this->editorUser);
$this
->drupalGet($path);
$this
->assertResponse(403);
$this
->drupalGet($path2);
$this
->assertResponse(200);
$this
->findNoField('domain');
}
}