public function PbfBaseTest::setUp in Permissions by field 8
Setup and Rebuild node access.
Overrides BrowserTestBase::setUp
8 calls to PbfBaseTest::setUp()
- PbfAccessByNodeRefTest::setUp in tests/
src/ Functional/ PbfAccessByNodeRefTest.php - Setup and create content whith Pbf field.
- PbfAccessByRoleTest::setUp in tests/
src/ Functional/ PbfAccessByRoleTest.php - Setup and create content whith Pbf field.
- PbfAccessByTermRefTest::setUp in tests/
src/ Functional/ PbfAccessByTermRefTest.php - Setup and create content with Pbf field.
- PbfAccessByUserDirectTest::setUp in tests/
src/ Functional/ PbfAccessByUserDirectTest.php - Setup and create content whith Pbf field.
- PbfAccessByUserRefTest::setUp in tests/
src/ Functional/ PbfAccessByUserRefTest.php - Setup and create content whith Pbf field.
8 methods override PbfBaseTest::setUp()
- PbfAccessByNodeRefTest::setUp in tests/
src/ Functional/ PbfAccessByNodeRefTest.php - Setup and create content whith Pbf field.
- PbfAccessByRoleTest::setUp in tests/
src/ Functional/ PbfAccessByRoleTest.php - Setup and create content whith Pbf field.
- PbfAccessByTermRefTest::setUp in tests/
src/ Functional/ PbfAccessByTermRefTest.php - Setup and create content with Pbf field.
- PbfAccessByUserDirectTest::setUp in tests/
src/ Functional/ PbfAccessByUserDirectTest.php - Setup and create content whith Pbf field.
- PbfAccessByUserRefTest::setUp in tests/
src/ Functional/ PbfAccessByUserRefTest.php - Setup and create content whith Pbf field.
File
- tests/
src/ Functional/ PbfBaseTest.php, line 161
Class
- PbfBaseTest
- General setup and helper function for testing pbf module.
Namespace
Drupal\Tests\pbf\FunctionalCode
public function setUp() {
parent::setUp();
$this
->drupalCreateContentType([
'type' => 'article',
]);
$this
->drupalCreateContentType([
'type' => 'group',
]);
$this->adminUser = $this
->drupalCreateUser([
'create article content',
'create group content',
'edit own article content',
'edit any article content',
'edit any group content',
'delete any article content',
'delete own article content',
'administer nodes',
'administer content types',
'administer node fields',
'administer account settings',
'administer node form display',
'administer node display',
'administer users',
'administer user fields',
'administer user form display',
'administer user display',
'bypass node access',
'search content',
'administer search',
]);
$this->permissions = [
'create article content',
'edit own article content',
'delete own article content',
'access content',
'search content',
'access user profiles',
];
$this->normalUser = $this
->drupalCreateUser($this->permissions);
$this->otherUser = $this
->drupalCreateUser($this->permissions);
// Create articles nodes.
$this->group1 = $this
->drupalCreateNode([
'type' => 'group',
'title' => 'Group 1',
]);
$this->group2 = $this
->drupalCreateNode([
'type' => 'group',
'title' => 'Group 2',
]);
// Create vocabulary and terms.
$this->vocabulary = $this
->createVocabulary();
$this->term1 = $this
->createTerm($this->vocabulary);
$this->term2 = $this
->createTerm($this->vocabulary);
$this->role1 = $this
->createRole($this->permissions);
node_access_rebuild();
}