You are here

protected function AbstractLegacyApiTest::validate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php \Symfony\Component\Validator\Tests\Validator\AbstractLegacyApiTest::validate()

Overrides AbstractValidatorTest::validate

1 call to AbstractLegacyApiTest::validate()
AbstractLegacyApiTest::testInitializeObjectsOnFirstValidation in vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php

File

vendor/symfony/validator/Tests/Validator/AbstractLegacyApiTest.php, line 52

Class

AbstractLegacyApiTest
Verifies that a validator satisfies the API of Symfony < 2.5.

Namespace

Symfony\Component\Validator\Tests\Validator

Code

protected function validate($value, $constraints = null, $groups = null) {
  if (null === $constraints) {
    $constraints = new Valid();
  }
  if ($constraints instanceof Valid) {
    return $this->validator
      ->validate($value, $groups, $constraints->traverse, $constraints->deep);
  }
  return $this->validator
    ->validateValue($value, $constraints, $groups);
}