public function Abstract2Dot5ApiTest::testNoDuplicateValidationIfClassConstraintInMultipleGroups in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php \Symfony\Component\Validator\Tests\Validator\Abstract2Dot5ApiTest::testNoDuplicateValidationIfClassConstraintInMultipleGroups()
File
- vendor/
symfony/ validator/ Tests/ Validator/ Abstract2Dot5ApiTest.php, line 602
Class
- Abstract2Dot5ApiTest
- Verifies that a validator satisfies the API of Symfony 2.5+.
Namespace
Symfony\Component\Validator\Tests\ValidatorCode
public function testNoDuplicateValidationIfClassConstraintInMultipleGroups() {
$entity = new Entity();
$callback = function ($value, ExecutionContextInterface $context) {
$context
->addViolation('Message');
};
$this->metadata
->addConstraint(new Callback(array(
'callback' => $callback,
'groups' => array(
'Group 1',
'Group 2',
),
)));
$violations = $this->validator
->validate($entity, new Valid(), array(
'Group 1',
'Group 2',
));
/* @var ConstraintViolationInterface[] $violations */
$this
->assertCount(1, $violations);
}