You are here

protected function AuditFilesConfigTest::setUp in Audit Files 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/AuditFilesConfigTest.php \Drupal\Tests\auditfiles\Functional\AuditFilesConfigTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/AuditFilesConfigTest.php, line 47

Class

AuditFilesConfigTest
Tests that the "Managed not used" report is reachable with no errors.

Namespace

Drupal\Tests\auditfiles\Functional

Code

protected function setUp() : void {
  parent::setUp();

  // Create user with permissions to manage site configuration and access
  // audit files reports.
  $this->user = $this
    ->drupalCreateUser([
    'configure audit files reports',
  ]);
  $all_rids = $this->user
    ->getRoles();
  unset($all_rids[array_search(RoleInterface::AUTHENTICATED_ID, $all_rids)]);

  // Save role IDs.
  $this->rid = reset($all_rids);
}