protected function RoleTest::createEntity in Drupal 9
Same name and namespace in other branches
- 8 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\FunctionalCode
protected function createEntity() {
  $role = Role::create([
    'id' => 'llama',
    'name' => $this
      ->randomString(),
  ]);
  $role
    ->save();
  return $role;
}