You are here

public function RangeValidatorTest::testInvalidValuesMax in Plug 7

@dataProvider getMoreThanTwenty

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php, line 127

Class

RangeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

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();
}