[Validator] Fixed misnamed method calls in FrameworkExtension
This commit is contained in:
parent
3dc2b4d861
commit
0bfde4a44b
@ -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']) {
|
||||
|
@ -8,7 +8,6 @@
|
||||
<parameter key="validator.class">Symfony\Component\Validator\ValidatorInterface</parameter>
|
||||
<parameter key="validator.builder.class">Symfony\Component\Validator\ValidatorBuilderInterface</parameter>
|
||||
<parameter key="validator.builder.factory.class">Symfony\Component\Validator\Validation</parameter>
|
||||
<parameter key="validator.mapping.class_metadata_factory.class">Symfony\Component\Validator\Mapping\ClassMetadataFactory</parameter>
|
||||
<parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter>
|
||||
<parameter key="validator.mapping.cache.prefix" />
|
||||
<parameter key="validator.validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory</parameter>
|
||||
@ -20,7 +19,7 @@
|
||||
<service id="validator" class="%validator.class%" factory-service="validator.builder" factory-method="getValidator" />
|
||||
|
||||
<service id="validator.builder" class="%validator.builder.class%" factory-class="%validator.builder.factory.class%" factory-method="createValidatorBuilder" public="false">
|
||||
<call method="setValidatorFactory">
|
||||
<call method="setConstraintValidatorFactory">
|
||||
<argument type="service" id="validator.validator_factory" />
|
||||
</call>
|
||||
<call method="setTranslator">
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user