You are here

protected function GroupContentStorageTest::createUnsavedUser in Group 8

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

Creates an unsaved user.

Parameters

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

Return value

\Drupal\user\Entity\User The created user entity.

1 call to GroupContentStorageTest::createUnsavedUser()
GroupContentStorageTest::testCreateForUnsavedEntity in tests/src/Kernel/GroupContentStorageTest.php
Tests the creation of a GroupContent entity using an unsaved entity.

File

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

Class

GroupContentStorageTest
Tests the behavior of group content storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

protected function createUnsavedUser($values = []) {
  $account = $this->entityTypeManager
    ->getStorage('user')
    ->create($values + [
    'name' => $this
      ->randomMachineName(),
    'status' => 1,
  ]);
  return $account;
}