You are here

protected function GroupKernelTestBase::createGroupType in Group 8

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

Creates a group type.

Parameters

array $values: (optional) The values used to create the entity.

Return value

\Drupal\group\Entity\GroupType The created group type entity.

15 calls to GroupKernelTestBase::createGroupType()
ChainGroupPermissionCalculatorTest::testCalculateAnonymousPermissions in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php
Tests the calculation of the anonymous permissions.
ChainGroupPermissionCalculatorTest::testCalculateOutsiderPermissions in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php
Tests the calculation of the outsider permissions.
EntityAccessComplexTest::setUp in tests/src/Kernel/EntityAccessComplexTest.php
EntityAccessTest::setUp in tests/src/Kernel/EntityAccessTest.php
EntityQueryAlterCacheabilityTest::setUp in tests/src/Kernel/EntityQueryAlterCacheabilityTest.php

... See full list

File

tests/src/Kernel/GroupKernelTestBase.php, line 84

Class

GroupKernelTestBase
Defines an abstract test base for group kernel tests.

Namespace

Drupal\Tests\group\Kernel

Code

protected function createGroupType(array $values = []) {
  $storage = $this->entityTypeManager
    ->getStorage('group_type');
  $group_type = $storage
    ->create($values + [
    'id' => $this
      ->randomMachineName(),
    'label' => $this
      ->randomString(),
  ]);
  $storage
    ->save($group_type);
  return $group_type;
}