You are here

protected function GroupContentStorageTest::createUnsavedGroup in Group 8

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

Creates an unsaved group.

Parameters

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

Return value

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

3 calls to GroupContentStorageTest::createUnsavedGroup()
GroupContentStorageTest::testCreateForUnsavedGroup in tests/src/Kernel/GroupContentStorageTest.php
Tests the creation of a GroupContent entity using an unsaved group.
GroupContentStorageTest::testLoadByUnsavedEntity in tests/src/Kernel/GroupContentStorageTest.php
Tests the loading of GroupContent entities for an unsaved entity.
GroupContentStorageTest::testLoadByUnsavedGroup in tests/src/Kernel/GroupContentStorageTest.php
Tests the loading of GroupContent entities for an unsaved group.

File

tests/src/Kernel/GroupContentStorageTest.php, line 52

Class

GroupContentStorageTest
Tests the behavior of group content storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

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