public static function getLineItemsThatResultInAnEmptyDelivery(): iterable
{ yield 'DeliveryCollection is empty if LineItemCollection is empty' =>
[new LineItemCollection()];
yield 'DeliveryCollection is empty if no LineItem has set deliveryInformation' =>
[new LineItemCollection([ (new LineItem('line-item-id', LineItem::CUSTOM_LINE_ITEM_TYPE, null, 1
)) ->
assign(['deliveryInformation' => null
]),
])];
yield 'DeliveryCollection is empty if LineItems deliveryTime is null' =>
[new LineItemCollection([ (new LineItem('line-item-id', LineItem::CUSTOM_LINE_ITEM_TYPE, null, 1
)) ->
assign(['deliveryInformation' =>
new DeliveryInformation(10, 1, false, null, null
)]),
])];
$deliveryTime = self::
createDeliveryTime(1, 3
);
yield 'DeliveryCollection is empty if LineItems price is not set' =>
[new LineItemCollection([ (new LineItem('line-item-id', LineItem::CUSTOM_LINE_ITEM_TYPE, null, 1
)) ->
assign([ 'deliveryInformation' =>
new DeliveryInformation(10, 1, false, 5,
$deliveryTime),
'price' => null,
]),
])];
}