You are here

protected function FieldRdfaTestBase::createTestField in Zircon Profile 8

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

Creates the field for testing.

Parameters

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

15 calls to FieldRdfaTestBase::createTestField()
DateTimeFieldRdfaTest::setUp in core/modules/rdf/src/Tests/Field/DateTimeFieldRdfaTest.php
Set the default field storage backend for fields created during tests.
EmailFieldRdfaTest::setUp in core/modules/rdf/src/Tests/Field/EmailFieldRdfaTest.php
Set the default field storage backend for fields created during tests.
FieldRdfaDatatypeCallbackTest::setUp in core/modules/rdf/src/Tests/Field/FieldRdfaDatatypeCallbackTest.php
Set the default field storage backend for fields created during tests.
LinkFieldRdfaTest::setUp in core/modules/rdf/src/Tests/Field/LinkFieldRdfaTest.php
Set the default field storage backend for fields created during tests.
NumberFieldRdfaTest::testDecimalFormatter in core/modules/rdf/src/Tests/Field/NumberFieldRdfaTest.php
Tests the decimal formatter.

... See full list

File

core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php, line 116
Contains \Drupal\rdf\Tests\Field\FieldRdfaTestBase.

Class

FieldRdfaTestBase

Namespace

Drupal\rdf\Tests\Field

Code

protected function createTestField($field_settings = array()) {
  entity_create('field_storage_config', array(
    'field_name' => $this->fieldName,
    'entity_type' => 'entity_test',
    'type' => $this->fieldType,
  ))
    ->save();
  entity_create('field_config', array(
    'entity_type' => 'entity_test',
    'field_name' => $this->fieldName,
    'bundle' => 'entity_test',
    'settings' => $field_settings,
  ))
    ->save();
}