function FieldDefinitionListenerTest::testOnFieldDefinitionUpdate
Tests on field definition update.
@legacy-covers ::onFieldDefinitionUpdate
File
-
core/
tests/ Drupal/ Tests/ Core/ Field/ FieldDefinitionListenerTest.php, line 187
Class
Namespace
Drupal\Tests\Core\FieldCode
public function testOnFieldDefinitionUpdate() : void {
$field_definition = $this->prophesize(FieldDefinitionInterface::class);
$field_definition->getTargetEntityTypeId()
->willReturn('test_entity_type');
$storage = $this->prophesize(DynamicallyFieldableEntityStorageInterface::class);
$storage->onFieldDefinitionUpdate($field_definition->reveal(), $field_definition->reveal())
->shouldBeCalledTimes(1);
$this->entityTypeManager
->getStorage('test_entity_type')
->willReturn($storage->reveal());
$entity = $this->prophesize(EntityTypeInterface::class);
$this->setUpEntityTypeManager([
'test_entity_type' => $entity,
]);
$this->fieldDefinitionListener
->onFieldDefinitionUpdate($field_definition->reveal(), $field_definition->reveal());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.