protected function AuditFilesNotInDatabaseTest::setUp in Audit Files 8.2
Same name and namespace in other branches
- 8.3 tests/src/Functional/AuditFilesNotInDatabaseTest.php \Drupal\Tests\auditfiles\Functional\AuditFilesNotInDatabaseTest::setUp()
Overrides BrowserTestBase::setUp
File
- tests/
src/ Functional/ AuditFilesNotInDatabaseTest.php, line 47
Class
- AuditFilesNotInDatabaseTest
- Tests that the "Not in Database" report is reachable with no errors.
Namespace
Drupal\Tests\auditfiles\FunctionalCode
protected function setUp() : void {
parent::setUp();
// Create user with permissions to manage site configuration and access
// audit files reports.
$this->user = $this
->drupalCreateUser([
'access 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);
// Create physical files.
// Possible values: 'binary', 'html', 'image', 'javascript', 'php', 'sql',
// 'text'.
$this
->getTestFiles('binary');
$this
->getTestFiles('html');
$this
->getTestFiles('image');
$this
->getTestFiles('javascript');
$this
->getTestFiles('php');
$this
->getTestFiles('sql');
$this
->getTestFiles('text');
}