public function ChoiceValidatorTest::testInvalidChoiceMultiple in Plug 7
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ ChoiceValidatorTest.php, line 170
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testInvalidChoiceMultiple() {
$constraint = new Choice(array(
'choices' => array(
'foo',
'bar',
),
'multipleMessage' => 'myMessage',
'multiple' => true,
));
$this->validator
->validate(array(
'foo',
'baz',
), $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ value }}', '"baz"')
->setInvalidValue('baz')
->setCode(Choice::NO_SUCH_CHOICE_ERROR)
->assertRaised();
}