You are here

protected function AbstractLegacyApiTest::validate in Plug 7

Overrides AbstractValidatorTest::validate

1 call to AbstractLegacyApiTest::validate()
AbstractLegacyApiTest::testInitializeObjectsOnFirstValidation in lib/Symfony/validator/Symfony/Component/Validator/Tests/Validator/AbstractLegacyApiTest.php

File

lib/Symfony/validator/Symfony/Component/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);
}