You are here

public function RangeValidatorTest::testInvalidValuesMin in Plug 7

@dataProvider getLessThanTen

File

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

Class

RangeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testInvalidValuesMin($value, $formattedValue) {
  $constraint = new Range(array(
    'min' => 10,
    'minMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($value, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ value }}', $formattedValue)
    ->setParameter('{{ limit }}', 10)
    ->setCode(Range::BELOW_RANGE_ERROR)
    ->assertRaised();
}