protected function ForwardTestBase::setUp in Forward 8
Same name and namespace in other branches
- 8.3 src/Tests/ForwardTestBase.php \Drupal\forward\Tests\ForwardTestBase::setUp()
- 8.2 src/Tests/ForwardTestBase.php \Drupal\forward\Tests\ForwardTestBase::setUp()
Perform any initial set up tasks that run before every test method
Overrides WebTestBase::setUp
File
- src/
Tests/ ForwardTestBase.php, line 43
Class
- ForwardTestBase
- Provides a base class for testing the Forward module.
Namespace
Drupal\forward\TestsCode
protected function setUp() {
parent::setUp();
// Create Basic page and Article node types.
if ($this->profile != 'standard') {
$this
->drupalCreateContentType(array(
'type' => 'page',
'name' => 'Basic page',
'display_submitted' => FALSE,
));
$this
->drupalCreateContentType(array(
'type' => 'article',
'name' => 'Article',
));
}
// Create test users.
$this->webUser = $this
->drupalCreateUser([
'access content',
]);
$this->forwardUser = $this
->drupalCreateUser([
'access content',
'access forward',
]);
$permissions = [
'access forward',
'administer forward',
'administer users',
'bypass node access',
];
$this->adminUser = $this
->drupalCreateUser($permissions);
}