You are here

protected function WorkbenchAccessTestTrait::setUpAdminUser in Workbench Access 8

Sets up a user with an editor role that has access to content.

Parameters

array $additional_permissions: Array of additional permissions beyond 'access administration pages' and 'assign workbench access'.

Return value

\Drupal\user\Entity\User The user entity.

7 calls to WorkbenchAccessTestTrait::setUpAdminUser()
AccessByRoleFormTest::doFormTests in tests/src/Functional/AccessByRoleFormTest.php
Test the form with the given section.
AccessByUserFormTest::doFormTests in tests/src/Functional/AccessByUserFormTest.php
Test the form with the given section.
AddSchemeFormTest::setUp in tests/src/Functional/AddSchemeFormTest.php
DeleteUserTest::testUserDelete in tests/src/Functional/DeleteUserTest.php
Tests that deleting a user clears their data from storage.
MenuSchemeUITest::setUp in tests/src/Functional/MenuSchemeUITest.php

... See full list

File

tests/src/Traits/WorkbenchAccessTestTrait.php, line 122

Class

WorkbenchAccessTestTrait
Contains helper classes for tests to set up various configuration.

Namespace

Drupal\Tests\workbench_access\Traits

Code

protected function setUpAdminUser(array $additional_permissions = []) {
  $admin_rid = $this
    ->createRole(array_merge($additional_permissions, [
    'access administration pages',
    'assign workbench access',
  ]), 'admin');
  return $this
    ->createUserWithRole($admin_rid);
}