bug #25480 [FrameworkBundle] add missing validation options to XSD file (xabbuh)
This PR was merged into the 2.7 branch.
Discussion
----------
[FrameworkBundle] add missing validation options to XSD file
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
e7d8e1783b
add missing validation options to XSD file
This commit is contained in:
commit
9ff3776b78
|
@ -204,6 +204,8 @@
|
|||
<xsd:attribute name="cache" type="xsd:string" />
|
||||
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
|
||||
<xsd:attribute name="static-method" type="xsd:boolean" />
|
||||
<xsd:attribute name="translation-domain" type="xsd:string" />
|
||||
<xsd:attribute name="strict-email" type="xsd:boolean" />
|
||||
<xsd:attribute name="api" type="validator_api_version" />
|
||||
</xsd:complexType>
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
$container->loadFromExtension('framework', array(
|
||||
'validation' => array(
|
||||
'strict_email' => true,
|
||||
),
|
||||
));
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
|
||||
$container->loadFromExtension('framework', array(
|
||||
'validation' => array(
|
||||
'translation_domain' => 'messages',
|
||||
),
|
||||
));
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" ?>
|
||||
<container xmlns="http://symfony.com/schema/dic/services"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:framework="http://symfony.com/schema/dic/symfony"
|
||||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
|
||||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||
|
||||
<framework:config>
|
||||
<framework:validation strict-email="true" />
|
||||
</framework:config>
|
||||
</container>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" ?>
|
||||
<container xmlns="http://symfony.com/schema/dic/services"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:framework="http://symfony.com/schema/dic/symfony"
|
||||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
|
||||
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||
|
||||
<framework:config>
|
||||
<framework:validation translation-domain="messages" />
|
||||
</framework:config>
|
||||
</container>
|
|
@ -0,0 +1,3 @@
|
|||
framework:
|
||||
validation:
|
||||
strict_email: true
|
|
@ -0,0 +1,3 @@
|
|||
framework:
|
||||
validation:
|
||||
translation_domain: messages
|
|
@ -420,6 +420,20 @@ abstract class FrameworkExtensionTest extends TestCase
|
|||
// no cache, no annotations, no static methods
|
||||
}
|
||||
|
||||
public function testValidationTranslationDomain()
|
||||
{
|
||||
$container = $this->createContainerFromFile('validation_translation_domain');
|
||||
|
||||
$this->assertSame('messages', $container->getParameter('validator.translation_domain'));
|
||||
}
|
||||
|
||||
public function testValidationStrictEmail()
|
||||
{
|
||||
$container = $this->createContainerFromFile('validation_strict_email');
|
||||
|
||||
$this->assertTrue($container->getDefinition('validator.email')->getArgument(0));
|
||||
}
|
||||
|
||||
public function testFormsCanBeEnabledWithoutCsrfProtection()
|
||||
{
|
||||
$container = $this->createContainerFromFile('form_no_csrf');
|
||||
|
|
Reference in New Issue