You are here

protected function RoleTest::createEntity in JSON:API 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/RoleTest.php \Drupal\Tests\jsonapi\Functional\RoleTest::createEntity()

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

Overrides ResourceTestBase::createEntity

File

tests/src/Functional/RoleTest.php, line 48

Class

RoleTest
JSON:API integration test for the "Role" config entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function createEntity() {
  $role = Role::create([
    'id' => 'llama',
    'name' => $this
      ->randomString(),
  ]);
  $role
    ->save();
  return $role;
}