public function ChoiceValidatorTest::testStrictAllowsExactValue

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php, line 234

Class

ChoiceValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testStrictAllowsExactValue() {
  $constraint = new Choice(array(
    'choices' => array(
      1,
      2,
    ),
    'strict' => true,
  ));
  $this->context
    ->expects($this
    ->never())
    ->method('addViolation');
  $this->validator
    ->validate(2, $constraint);
}