public function WorkbenchAccessTestTrait::setUpEditorUser in Workbench Access 8
Sets up a user with an editor role that has access to content.
Return value
\Drupal\user\Entity\User The user entity.
6 calls to WorkbenchAccessTestTrait::setUpEditorUser()
- AccessCacheTest::testNodeEdit in tests/
src/ Functional/ AccessCacheTest.php - Tests that the user can edit the node when allowed.
- DeleteUserTest::testUserDelete in tests/
src/ Functional/ DeleteUserTest.php - Tests that deleting a user clears their data from storage.
- InlineEntityFormTest::testInlineEntityForm in tests/
src/ Kernel/ InlineEntityFormTest.php - Tests that workbench_access integrates with inline_entity_form.
- NodeFormMenuTest::testNodeForm in tests/
src/ Functional/ NodeFormMenuTest.php - Tests that the user can see all valid options on the node form.
- NodeFormMultipleTest::runFieldTest in tests/
src/ Functional/ NodeFormMultipleTest.php - Runs tests against different field configurations.
File
- tests/
src/ Traits/ WorkbenchAccessTestTrait.php, line 99
Class
- WorkbenchAccessTestTrait
- Contains helper classes for tests to set up various configuration.
Namespace
Drupal\Tests\workbench_access\TraitsCode
public function setUpEditorUser() {
$editor_rid = $this
->createRole([
'access administration pages',
'create page content',
'edit any page content',
'administer menu',
'delete any page content',
'use workbench access',
], 'editor');
return $this
->createUserWithRole($editor_rid);
}