->
setCode('5'
) ->
addViolation();
$this->
assertViolationEquals(new ConstraintViolation($this->messageTemplate,
$this->messageTemplate,
[],
$this->root, 'data', 'foo', null, '5',
new Valid()));
} public function testCauseCanBeSet() { $cause =
new \
LogicException();
$this->builder
->
setCause($cause) ->
addViolation();
$this->
assertViolationEquals(new ConstraintViolation($this->messageTemplate,
$this->messageTemplate,
[],
$this->root, 'data', 'foo', null, null,
new Valid(),
$cause));
} public function testTranslationDomainFalse() { $translator =
$this->
createMock(TranslatorInterface::
class);
$translator->
expects(self::
once())->
method('trans'
)->
willReturn(''
);
$builder =
new ConstraintViolationBuilder($this->violations,
new Valid(),
$this->messageTemplate,
[],
$this->root, 'data', 'foo',
$translator);