public function RangeValidatorTest::testMaxMessageIsSet

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php, line 220

Class

RangeValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testMaxMessageIsSet() {
  $constraint = new Range(array(
    'min' => 10,
    'max' => 20,
    'maxMessage' => 'myMessage',
  ));
  $this->context
    ->expects($this
    ->once())
    ->method('addViolation')
    ->with('myMessage', array(
    '{{ value }}' => 21,
    '{{ limit }}' => 20,
  ));
  $this->validator
    ->validate(21, $constraint);
}