You are here

protected function GroupBrowserTestBase::createGroup in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/GroupBrowserTestBase.php \Drupal\Tests\group\Functional\GroupBrowserTestBase::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.

1 call to GroupBrowserTestBase::createGroup()
EntityOperationsTest::testEntityOperations in tests/src/Functional/EntityOperationsTest.php
Checks for entity operations under given circumstances.

File

tests/src/Functional/GroupBrowserTestBase.php, line 71

Class

GroupBrowserTestBase
Provides a base class for Group functional tests.

Namespace

Drupal\Tests\group\Functional

Code

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