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