private EntityRepository
$conditionRepository;
private Context
$context;
private ShippingZipCodeRule
$rule;
protected function setUp(): void
{ $this->ruleRepository =
$this->
getContainer()->
get('rule.repository'
);
$this->conditionRepository =
$this->
getContainer()->
get('rule_condition.repository'
);
$this->context = Context::
createDefaultContext();
$this->rule =
new ShippingZipCodeRule();
} public function testValidateWithMissingZipCodes(): void
{ // reset from previous tests
$this->
getContainer()->
get(ShippingZipCodeRule::
class)->
assign(['operator' => Rule::OPERATOR_EQ, 'zipCodes' => null
]);
$conditionId = Uuid::
randomHex();
try { $this->conditionRepository->
create([ [