function FieldStorageConfigResourceTestBase::createEntity

Same name in other branches
  1. 9 core/modules/field/tests/src/Functional/Rest/FieldStorageConfigResourceTestBase.php \Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase::createEntity()
  2. 8.9.x core/modules/field/tests/src/Functional/Rest/FieldStorageConfigResourceTestBase.php \Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase::createEntity()
  3. 10 core/modules/field/tests/src/Functional/Rest/FieldStorageConfigResourceTestBase.php \Drupal\Tests\field\Functional\Rest\FieldStorageConfigResourceTestBase::createEntity()

Overrides EntityResourceTestBase::createEntity

File

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

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.