public function CountValidatorTest::testTooFewValuesExact in Plug 7
@dataProvider getThreeOrLessElements
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ CountValidatorTest.php, line 177
Class
- CountValidatorTest
- @author Bernhard Schussek <bschussek@gmail.com>
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testTooFewValuesExact($value) {
$constraint = new Count(array(
'min' => 4,
'max' => 4,
'exactMessage' => 'myMessage',
));
$this->validator
->validate($value, $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ count }}', count($value))
->setParameter('{{ limit }}', 4)
->setInvalidValue($value)
->setPlural(4)
->setCode(Count::TOO_FEW_ERROR)
->assertRaised();
}