/**
* {@inheritdoc}
*/
protected static $modules =
['entity_test'
];
/**
* @covers ::copyFormValuesToEntity
*/
public function testCopyFormValuesToEntity() { $field_values =
[];
$entity =
$this->
prophesize(EntityDisplayInterface::
class);
$entity->
getPluginCollections()->
willReturn([]);
$entity->
getTargetEntityTypeId()->
willReturn('entity_test_with_bundle'
);
$entity->
getTargetBundle()->
willReturn('target_bundle'
);
// An initially hidden field, with a submitted region change.
$entity->
getComponent('new_field_mismatch_type_visible'
)->
willReturn([]);
$field_values['new_field_mismatch_type_visible'
] =
[ 'weight' => 0,
'type' => 'textfield',
'region' => 'hidden',
];
$entity->
removeComponent('new_field_mismatch_type_visible'
)