function FieldStorageGetPropertyDefinitionTest::testGetPropertyDefinition

Tests getPropertyDefinition().

File

core/tests/Drupal/KernelTests/Core/Field/FieldStorageGetPropertyDefinitionTest.php, line 30

Class

FieldStorageGetPropertyDefinitionTest
Tests getting property definitions from field storages.

Namespace

Drupal\KernelTests\Core\Field

Code

public function testGetPropertyDefinition() : void {
  $this->assertInstanceOf(DataDefinitionInterface::class, BaseFieldDefinition::create('string')->getFieldStorageDefinition()
    ->getPropertyDefinition('value'));
  $this->assertInstanceOf(DataDefinitionInterface::class, FieldStorageConfig::create([
    'field_name' => 'test_field',
    'entity_type' => 'entity_test',
    'type' => 'test_field',
  ])->getPropertyDefinition('value'));
}

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