public function RangeValidatorTest::testInvalidValuesMax in Plug 7
@dataProvider getMoreThanTwenty
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Constraints/ RangeValidatorTest.php, line 127
Class
Namespace
Symfony\Component\Validator\Tests\ConstraintsCode
public function testInvalidValuesMax($value, $formattedValue) {
$constraint = new Range(array(
'max' => 20,
'maxMessage' => 'myMessage',
));
$this->validator
->validate($value, $constraint);
$this
->buildViolation('myMessage')
->setParameter('{{ value }}', $formattedValue)
->setParameter('{{ limit }}', 20)
->setCode(Range::BEYOND_RANGE_ERROR)
->assertRaised();
}