You are here

protected function LegacyValidatorLegacyApiTest::createValidator in Zircon Profile 8

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

Parameters

MetadataFactoryInterface $metadataFactory:

Return value

LegacyValidatorInterface

Overrides AbstractLegacyApiTest::createValidator

File

vendor/symfony/validator/Tests/Validator/LegacyValidatorLegacyApiTest.php, line 25

Class

LegacyValidatorLegacyApiTest
@group legacy

Namespace

Symfony\Component\Validator\Tests\Validator

Code

protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array()) {
  $translator = new IdentityTranslator();
  $translator
    ->setLocale('en');
  $contextFactory = new LegacyExecutionContextFactory($metadataFactory, $translator);
  $validatorFactory = new ConstraintValidatorFactory();
  return new LegacyValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers);
}