public function ChoiceValidatorTest::testValidChoiceCallbackClosure

File

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

Class

ChoiceValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testValidChoiceCallbackClosure() {
  $constraint = new Choice(array(
    'callback' => function () {
      return array(
        'foo',
        'bar',
      );
    },
  ));
  $this->context
    ->expects($this
    ->never())
    ->method('addViolation');
  $this->validator
    ->validate('bar', $constraint);
}