function FieldRdfaTestBase::createTestField

Same name and namespace in other branches
  1. 9 core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php \Drupal\Tests\rdf\Kernel\Field\FieldRdfaTestBase::createTestField()

Creates the field for testing.

Parameters

array $field_settings: (optional) An array of field settings.

File

core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php, line 111

Class

FieldRdfaTestBase

Namespace

Drupal\Tests\rdf\Kernel\Field

Code

protected function createTestField($field_settings = []) {
  FieldStorageConfig::create([
    'field_name' => $this->fieldName,
    'entity_type' => 'entity_test',
    'type' => $this->fieldType,
  ])
    ->save();
  FieldConfig::create([
    'entity_type' => 'entity_test',
    'field_name' => $this->fieldName,
    'bundle' => 'entity_test',
    'settings' => $field_settings,
  ])
    ->save();
}

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