$this->ruleRepository =
$this->
getContainer()->
get('rule.repository'
);
$this->conditionRepository =
$this->
getContainer()->
get('rule_condition.repository'
);
$this->context = Context::
createDefaultContext();
} public function testValidateWithMissingValues(): void
{ try { $this->conditionRepository->
create([ [ 'type'
=> (new LineItemsInCartCountRule())->
getName(),
'ruleId' => Uuid::
randomHex(),
],
],
$this->context
);
static::
fail('Exception was not thrown'
);
} catch (WriteException
$stackException) { $exceptions =
iterator_to_array($stackException->
getErrors());
static::
assertCount(2,
$exceptions);
static::
assertSame('/0/value/count',
$exceptions[0
]['source'
]['pointer'
]);
static::
assertSame(NotBlank::IS_BLANK_ERROR,
$exceptions[0
]['code'
]);
static::
assertSame('/0/value/operator',
$exceptions[1
]['source'
]['pointer'
]);