public function ChoiceValidatorTest::testStrictWithMultipleChoices in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/validator/Tests/Constraints/ChoiceValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\ChoiceValidatorTest::testStrictWithMultipleChoices()
File
- vendor/
symfony/ validator/ Tests/ Constraints/ ChoiceValidatorTest.php, line 287
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testStrictWithMultipleChoices() {
$constraint = new Choice(array(
'choices' => array(
1,
2,
3,
),
'multiple' => true,
'strict' => true,
'multipleMessage' => 'myMessage',
));
$this->validator
->validate(array(
2,
'3',
), $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ value }}', '"3"')
->setInvalidValue('3')
->setCode(Choice::NO_SUCH_CHOICE_ERROR)
->assertRaised();
}