protected function NodeAdminTest::setUp in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/node/src/Tests/NodeAdminTest.php \Drupal\node\Tests\NodeAdminTest::setUp()
Sets up a Drupal site for running functional and integration tests.
Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.
Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.
After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.
Overrides NodeTestBase::setUp
File
- core/
modules/ node/ src/ Tests/ NodeAdminTest.php, line 53 - Contains \Drupal\node\Tests\NodeAdminTest.
Class
- NodeAdminTest
- Tests node administration page functionality.
Namespace
Drupal\node\TestsCode
protected function setUp() {
parent::setUp();
// Remove the "view own unpublished content" permission which is set
// by default for authenticated users so we can test this permission
// correctly.
user_role_revoke_permissions(RoleInterface::AUTHENTICATED_ID, array(
'view own unpublished content',
));
$this->adminUser = $this
->drupalCreateUser(array(
'access administration pages',
'access content overview',
'administer nodes',
'bypass node access',
));
$this->baseUser1 = $this
->drupalCreateUser([
'access content overview',
]);
$this->baseUser2 = $this
->drupalCreateUser([
'access content overview',
'view own unpublished content',
]);
$this->baseUser3 = $this
->drupalCreateUser([
'access content overview',
'bypass node access',
]);
}