/**
* This test verifies that we have finished building our
* package, as soon as we have reached a gross item price of 100.0.
* This is archived with 2 items - but most important - only if taxes are considered.
* Otherwise it would be 3 items.
*
* @group lineitemgroup
*/
public function testPackageDoneWhenSumReached(): void
{ $items =
new LineItemFlatCollection();
$items->
add($this->
createProductItem(49, 19
));
$items->
add($this->
createProductItem(49, 19
));
$items->
add($this->
createProductItem(49, 19
));
$items->
add($this->
createProductItem(49, 19
));
$items->
add($this->
createProductItem(49, 19
));
$items->
add($this->
createProductItem(49, 19
));
$items->
add($this->
createProductItem(49, 19
));
$packageItems =
$this->packager->
buildGroupPackage(100,
$items,
$this->context
);
// verify we have 2 items, then we have reached 100.0
static::
assertCount(2,
$packageItems->
getItems());
}