Fixed the retrieval of the validation MetadataFactory

The service is private so getting it from the container get() method is invalid and it does not work anymore in Symfony 2.5 because the service gets inlined.
This commit is contained in:
Christophe Coevoet 2014-06-18 09:38:16 +02:00
parent df1c85ae5e
commit 8d3fd662bf

View File

@ -13,7 +13,7 @@ class ValidationParserTest extends WebTestCase
public function setUp() public function setUp()
{ {
$container = $this->getContainer(); $container = $this->getContainer();
$factory = $container->get('validator.mapping.class_metadata_factory'); $factory = $container->get('validator')->getMetadataFactory();
if (version_compare(Kernel::VERSION, '2.2.0', '<')) { if (version_compare(Kernel::VERSION, '2.2.0', '<')) {
$this->parser = new ValidationParserLegacy($factory); $this->parser = new ValidationParserLegacy($factory);