diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
index 94516e0463..7efa03272a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -709,7 +709,7 @@ class FrameworkExtension extends Extension
'validator_'.hash('sha256', $container->getParameter('kernel.root_dir'))
);
- $validatorBuilder->addMethodCall('setCache', array(new Reference('validator.mapping.cache.'.$config['cache'])));
+ $validatorBuilder->addMethodCall('setMetadataCache', array(new Reference('validator.mapping.cache.'.$config['cache'])));
}
if ('auto' !== $config['api']) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
index bf54f92603..945a891c8d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/validator.xml
@@ -8,7 +8,6 @@
Symfony\Component\Validator\ValidatorInterface
Symfony\Component\Validator\ValidatorBuilderInterface
Symfony\Component\Validator\Validation
- Symfony\Component\Validator\Mapping\ClassMetadataFactory
Symfony\Component\Validator\Mapping\Cache\ApcCache
Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory
@@ -20,7 +19,7 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index f828f25d03..55cd188c7c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -265,7 +265,7 @@ abstract class FrameworkExtensionTest extends TestCase
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
$this->assertCount(6, $calls);
- $this->assertSame('setValidatorFactory', $calls[0][0]);
+ $this->assertSame('setConstraintValidatorFactory', $calls[0][0]);
$this->assertEquals(array(new Reference('validator.validator_factory')), $calls[0][1]);
$this->assertSame('setTranslator', $calls[1][0]);
$this->assertEquals(array(new Reference('translator')), $calls[1][1]);
@@ -275,8 +275,9 @@ abstract class FrameworkExtensionTest extends TestCase
$this->assertSame(array($xmlMappings), $calls[3][1]);
$this->assertSame('addMethodMapping', $calls[4][0]);
$this->assertSame(array('loadClassMetadata'), $calls[4][1]);
- $this->assertSame('setCache', $calls[5][0]);
+ $this->assertSame('setMetadataCache', $calls[5][0]);
$this->assertEquals(array(new Reference('validator.mapping.cache.apc')), $calls[5][1]);
+ $this->assertInstanceOf('Symfony\Component\Validator\ValidatorInterface', $container->get('validator'));
}
public function testAnnotations()