You are here

public function UserCreateTest::testUserCreate in Apigee Edge 8

Test user create.

File

tests/src/Kernel/UserCreateTest.php, line 98

Class

UserCreateTest
Test create operations for User entity type.

Namespace

Drupal\Tests\apigee_edge\Kernel

Code

public function testUserCreate() {
  $this->account = User::create([
    'mail' => $this
      ->randomMachineName() . '@example.com',
    'name' => $this
      ->randomMachineName(),
    'first_name' => $this
      ->randomMachineName(64),
    'last_name' => $this
      ->randomMachineName(64),
  ]);
  $this
    ->queueDeveloperResponse($this->account, 201);
  $this
    ->assertEquals(SAVED_NEW, $this->account
    ->save());
}