/**
* @return iterable<array{0: LineItemCollection, 1: DeliveryDate}>
*/
public static function provideLineItemDataForSingleDelivery(): iterable
{ yield 'Shipping method delivery data is used if position has no own delivery time' =>
[ new LineItemCollection([ (new LineItem('line-item-id', LineItem::CUSTOM_LINE_ITEM_TYPE, null, 1
)) ->
assign([ 'deliveryInformation' => self::
createDeliveryInformation(null, 0
),
'price' =>
new CalculatedPrice(0, 0,
new CalculatedTaxCollection(),
new TaxRuleCollection()),
]),
]),
DeliveryDate::
createFromDeliveryTime(self::
createDeliveryTime(2, 3
)),
];
yield 'It takes delivery time of position if line item is in stock' =>
[ new LineItemCollection([ (new LineItem('line-item-id', LineItem::CUSTOM_LINE_ITEM_TYPE, null, 1
)) ->
assign([ 'deliveryInformation' => self::
createDeliveryInformation(self::
createDeliveryTime(4, 5
), 0
),