4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Validator\Tests\Validator;
14 use Symfony\Component\Translation\IdentityTranslator;
15 use Symfony\Component\Validator\ConstraintValidatorFactory;
16 use Symfony\Component\Validator\Context\LegacyExecutionContextFactory;
17 use Symfony\Component\Validator\MetadataFactoryInterface;
18 use Symfony\Component\Validator\Validator\LegacyValidator;
23 class LegacyValidatorLegacyApiTest extends AbstractLegacyApiTest
25 protected function createValidator(MetadataFactoryInterface $metadataFactory, array $objectInitializers = array())
27 $translator = new IdentityTranslator();
28 $translator->setLocale('en');
30 $contextFactory = new LegacyExecutionContextFactory($metadataFactory, $translator);
31 $validatorFactory = new ConstraintValidatorFactory();
33 return new LegacyValidator($contextFactory, $metadataFactory, $validatorFactory, $objectInitializers);