public function testCanOnlyFind1Group(): void
{ $cart =
$this->
buildCart(3
);
$groupDefinition =
$this->
buildGroup(self::KEY_PACKAGER_COUNT, 2, self::KEY_SORTER_PRICE_ASC,
new RuleCollection());
$result =
$this->unitTestBuilder->
findGroupPackages([$groupDefinition],
$cart,
$this->context
);
/** @var LineItemQuantity[] $items */
$items =
array_values($result->
getGroupTotalResult($groupDefinition));
static::
assertCount(2,
$items);
} /**
* This test verifies that we build as many group results as possible.
* We make groups for every 2 items. Our cart has 7 items, so we
* have a total of 6 (3 x 2) resulting items.
*
* @group lineitemgroup
*/