public function testRulesMatchingFirst(): void
{ $cart =
$this->
buildCart(1
);
$group =
$this->
buildGroup('FAKE-PACKAGER', 2, 'FAKE-SORTER',
new RuleCollection());
$this->integrationTestBuilder->
findGroupPackages([$group],
$cart,
$this->context
);
$countMatcher =
$this->fakeTakeAllRuleMatcher->
getSequenceCount();
$countSorter =
$this->fakeSorter->
getSequenceCount();
$countPackager =
$this->fakeTakeAllPackager->
getSequenceCount();
// check if the matcher is called before the other objects
$isCalledFirst =
($countSorter <
$countMatcher) && ($countMatcher <
$countPackager);
static::
assertTrue($isCalledFirst, 'Matcher: ' .
$countMatcher . ', Sorter: ' .
$countSorter . ', Packager: ' .
$countPackager);
}