You are here

protected function ProfileViewTest::createUser in Profile 8

Create a user, and optionally a profile.

Return value

\Drupal\user\UserInterface A newly created user.

File

tests/src/Kernel/ProfileViewTest.php, line 99

Class

ProfileViewTest
Tests profile integration with Views.

Namespace

Drupal\Tests\profile\Kernel

Code

protected function createUser() {
  $user = User::create([
    'name' => mb_strtolower($this
      ->randomMachineName()),
    'status' => TRUE,
  ]);
  $user
    ->save();
  return $user;
}