You are here

protected function FieldDefaultTokenKernelTestBase::createField in Field default token 8

Creates a test field configuration.

Return value

\Drupal\field\Entity\FieldConfig The field configuration.

5 calls to FieldDefaultTokenKernelTestBase::createField()
FieldDefaultTokenBasicTest::testCallbackExistingField in tests/src/Kernel/FieldDefaultTokenBasicTest.php
Tests that the default value callback is registered for an existing field.
FieldDefaultTokenBasicTest::testCallbackNewField in tests/src/Kernel/FieldDefaultTokenBasicTest.php
Tests that the default value callback is registered for a new field.
FieldDefaultTokenBasicTest::testCallbackRemoval in tests/src/Kernel/FieldDefaultTokenBasicTest.php
Tests the the default value callback is removed properly.
FieldDefaultTokenBasicTest::testReplacement in tests/src/Kernel/FieldDefaultTokenBasicTest.php
Test that tokens in a field default value get replaced properly.
FieldDefaultTokenNodeTest::testReplacement in tests/src/Kernel/FieldDefaultTokenNodeTest.php
Test that tokens in a field default value get replaced properly.

File

tests/src/Kernel/FieldDefaultTokenKernelTestBase.php, line 61

Class

FieldDefaultTokenKernelTestBase
Provides a common base class for kernel tests of Field Default Token module.

Namespace

Drupal\Tests\field_default_token\Kernel

Code

protected function createField() {
  return FieldConfig::create([
    'field_name' => $this->fieldName,
    'entity_type' => $this->entityTypeId,
    'bundle' => $this->bundle ?: $this->entityTypeId,
  ]);
}