$this->
expectException(ConstraintDefinitionException::
class);
$object =
new CallbackValidatorTest_Object();
$this->validator->
validate($object,
new Callback(['callback' =>
['foo', 'bar'
]]));
} public function testConstraintGetTargets() { $constraint =
new Callback([]);
$targets =
[Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT
];
$this->
assertEquals($targets,
$constraint->
getTargets());
} // Should succeed. Needed when defining constraints as annotations.
public function testNoConstructorArguments() { $constraint =
new Callback();
$this->
assertSame([Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT
],
$constraint->
getTargets());
} public function testAnnotationInvocationSingleValued() {