You are here

protected function FieldStorageConfigResourceTestBase::createEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/tests/src/Functional/Rest/FieldStorageConfigResourceTestBase.php \Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase::createEntity()

Creates the entity to be tested.

Return value

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

Overrides EntityResourceTestBase::createEntity

File

core/modules/field/tests/src/Functional/Rest/FieldStorageConfigResourceTestBase.php, line 35

Class

FieldStorageConfigResourceTestBase

Namespace

Drupal\Tests\field\Functional\Rest

Code

protected function createEntity() {
  $field_storage = FieldStorageConfig::create([
    'field_name' => 'true_llama',
    'entity_type' => 'node',
    'type' => 'boolean',
  ]);
  $field_storage
    ->save();
  return $field_storage;
}