You are here

protected function GroupKernelTestBase::createGroup in Group 8

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

Creates a group.

Parameters

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

Return value

\Drupal\group\Entity\Group The created group entity.

107 calls to GroupKernelTestBase::createGroup()
ChainGroupPermissionCalculatorTest::testCalculateAuthenticatedPermissions in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php
Tests the calculation of the authenticated permissions.
ChainGroupPermissionCalculatorTest::testCalculateMemberPermissions in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php
Tests the calculation of the member permissions.
ChainGroupPermissionCalculatorTest::testCalculateMultipleMembersPermissions in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php
Test members permissions with multiple users, groups and group roles.
ChainGroupPermissionCalculatorTest::testCalculatePermissions in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php
Tests the calculation of an account's permissions.
EntityAccessComplexTest::testAnonymousViewAnyPublishedAccess in tests/src/Kernel/EntityAccessComplexTest.php
Tests the viewing of any published grouped entities for anonymous.

... See full list

File

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

Class

GroupKernelTestBase
Defines an abstract test base for group kernel tests.

Namespace

Drupal\Tests\group\Kernel

Code

protected function createGroup(array $values = []) {
  $storage = $this->entityTypeManager
    ->getStorage('group');
  $group = $storage
    ->create($values + [
    'type' => 'default',
    'label' => $this
      ->randomString(),
  ]);
  $group
    ->enforceIsNew();
  $storage
    ->save($group);
  return $group;
}