->
willReturn(TRUE
);
$field_storage_definition =
$this->
createMock('Drupal\Core\Field\FieldStorageDefinitionInterface'
);
$field_storage_definition->
expects($this->
any()) ->
method('getPropertyDefinitions'
) ->
willReturn($property_definitions);
$field_definition =
$this->
createMock('Drupal\Core\Field\FieldDefinitionInterface'
);
$field_definition->
expects($this->
any()) ->
method('getFieldStorageDefinition'
) ->
willReturn($field_storage_definition);
$field_list_a =
new FieldItemList($field_definition);
$field_list_b =
new FieldItemList($field_definition);
// Set up the mocking necessary for creating field items.
$field_type_manager->
expects($this->
any()) ->
method('createFieldItem'
) ->
willReturnOnConsecutiveCalls($first_field_item,
$second_field_item);
// Set the field item values.
if ($first_field_item instanceof FieldItemInterface
) { $field_list_a->
setValue($first_field_item);
}