public function ConfigFieldDefinitionTest::testFieldStorageDefinition in Drupal 10
Same name and namespace in other branches
- 8 core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php \Drupal\Tests\field\Kernel\ConfigFieldDefinitionTest::testFieldStorageDefinition()
- 9 core/modules/field/tests/src/Kernel/ConfigFieldDefinitionTest.php \Drupal\Tests\field\Kernel\ConfigFieldDefinitionTest::testFieldStorageDefinition()
Makes sure a field storage definition is exposed for a configurable field.
File
- core/
modules/ field/ tests/ src/ Kernel/ ConfigFieldDefinitionTest.php, line 56
Class
- ConfigFieldDefinitionTest
- Tests exposing field definitions for configurable fields.
Namespace
Drupal\Tests\field\KernelCode
public function testFieldStorageDefinition() {
$field_storage_definitions = \Drupal::service('entity_field.manager')
->getFieldStorageDefinitions($this->entityType);
$this
->assertTrue(isset($field_storage_definitions[$this->fieldTestData->field
->getName()]));
$this
->assertInstanceOf(FieldStorageDefinitionInterface::class, $field_storage_definitions[$this->fieldTestData->field
->getName()]);
// Make sure storages on other entity types are not exposed.
$this
->assertFalse(isset($field_storage_definitions[$this->fieldTestData->field_rev
->getName()]));
}