You are here

protected function RoleTest::createEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/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

core/modules/jsonapi/tests/src/Functional/RoleTest.php, line 53

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;
}