You are here

protected function EntityTestMapFieldTest::createEntity in JSON:API 8.2

Creates the entity to be tested.

Return value

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

Overrides ResourceTestBase::createEntity

File

tests/src/Functional/EntityTestMapFieldTest.php, line 72

Class

EntityTestMapFieldTest
JSON:API integration test for the "EntityTestMapField" content entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function createEntity() {
  $entity = EntityTestMapField::create([
    'name' => 'Llama',
    'type' => 'entity_test_map_field',
    'data' => [
      static::$mapValue,
    ],
  ]);
  $entity
    ->setOwnerId(0);
  $entity
    ->save();
  return $entity;
}