You are here

public function LengthValidatorTest::testInvalidValuesMin in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/validator/Tests/Constraints/LengthValidatorTest.php \Symfony\Component\Validator\Tests\Constraints\LengthValidatorTest::testInvalidValuesMin()

@dataProvider getThreeOrLessCharacters

File

vendor/symfony/validator/Tests/Constraints/LengthValidatorTest.php, line 140

Class

LengthValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testInvalidValuesMin($value) {
  $constraint = new Length(array(
    'min' => 4,
    'minMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($value, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ value }}', '"' . $value . '"')
    ->setParameter('{{ limit }}', 4)
    ->setInvalidValue($value)
    ->setPlural(4)
    ->setCode(Length::TOO_SHORT_ERROR)
    ->assertRaised();
}