You are here

protected function RevisionUiAccessTest::setUp in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/RevisionUiAccessTest.php \Drupal\Tests\group\Kernel\RevisionUiAccessTest::setUp()

Overrides GroupKernelTestBase::setUp

File

tests/src/Kernel/RevisionUiAccessTest.php, line 50

Class

RevisionUiAccessTest
Tests the revision UI access for groups.

Namespace

Drupal\Tests\group\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this->accessManager = $this->container
    ->get('access_manager');
  $this->routeProvider = $this->container
    ->get('router.route_provider');
  $this->groupType = $this
    ->createGroupType([
    'id' => 'revision_test',
    'creator_membership' => FALSE,
  ]);
  $this->adminRole = $this->entityTypeManager
    ->getStorage('group_role')
    ->create([
    'id' => 'revision_test-admin',
    'label' => 'Revision admin',
    'weight' => 0,
    'group_type' => $this->groupType
      ->id(),
  ]);
  $this->adminRole
    ->grantPermission('administer group')
    ->save();
}