You are here

public function CountValidatorTest::testTooFewValues in Zircon Profile 8.0

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

@dataProvider getThreeOrLessElements

File

vendor/symfony/validator/Tests/Constraints/CountValidatorTest.php, line 134

Class

CountValidatorTest
@author Bernhard Schussek <bschussek@gmail.com>

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testTooFewValues($value) {
  $constraint = new Count(array(
    'min' => 4,
    'minMessage' => 'myMessage',
  ));
  $this->validator
    ->validate($value, $constraint);
  $this
    ->buildViolation('myMessage')
    ->setParameter('{{ count }}', count($value))
    ->setParameter('{{ limit }}', 4)
    ->setInvalidValue($value)
    ->setPlural(4)
    ->setCode(Count::TOO_FEW_ERROR)
    ->assertRaised();
}