array
$categoryIds,
string
$operator,
array
$lineItemCategoryIds,
bool
$expected ): void
{ $this->rule->
assign([ 'categoryIds' =>
$categoryIds,
'operator' =>
$operator,
]);
$match =
$this->rule->
match(new LineItemScope( $this->
createLineItemWithCategories($lineItemCategoryIds),
$this->
createMock(SalesChannelContext::
class) ));
static::
assertSame($expected,
$match);
} public static function getLineItemScopeTestData(): \Generator
{ yield 'single product / equal / match category id' =>
[['1', '2'
], Rule::OPERATOR_EQ,
['1'
], true
];
yield 'single product / equal / no match' =>
[['1', '2'
], Rule::OPERATOR_EQ,
['3'
], false
];
yield 'single product / not equal / match category id' =>
[['1', '2'
], Rule::OPERATOR_NEQ,
['3'
], true
];