8000 Merge branch '3.4' into 4.2 · devrck/symfony@c58d4c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c58d4c2

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: allow to skip tests based on the supported version Update validators.bg.xlf Update validators.ca.xlf fixed CS Updated validators.eu.xlf with missing translations fixed typo backported a translation [Validator] added missing translation for UK validator Validator: add the Persian translations Update validators.sq.xlf fixed CS forward valid numeric values to transform() add constraint validators before optimizations
2 parents 1614a52 + 37b0eeb commit c58d4c2

File tree

23 files changed

+5
lines changed
  • Validator/Resources/translations
  • 23 files changed

    +343
    -5
    lines changed

    src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -30,6 +30,8 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
    3030
    */
    3131
    private $em;
    3232

    33+
    protected static $supportedFeatureSetVersion = 304;
    34+
    3335
    protected function getExtensions()
    3436
    {
    3537
    $manager = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();

    src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -57,6 +57,8 @@ class EntityTypeTest extends BaseTypeTest
    5757
    */
    5858
    private $emRegistry;
    5959

    60+
    protected static $supportedFeatureSetVersion = 304;
    61+
    6062
    protected function setUp()
    6163
    {
    6264
    $this->em = DoctrineTestHelper::createTestEntityManager();

    src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -16,6 +16,8 @@
    1616

    1717
    abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
    1818
    {
    19+
    protected static $supportedFeatureSetVersion = 304;
    20+
    1921
    public function testLabelOnForm()
    2022
    {
    2123
    $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType');

    src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -31,6 +31,8 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
    3131
    */
    3232
    private $renderer;
    3333

    34+
    protected static $supportedFeatureSetVersion = 304;
    35+
    3436
    protected function setUp()
    3537
    {
    3638
    parent::setUp();

    src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -30,6 +30,8 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
    3030
    */
    3131
    private $renderer;
    3232

    33+
    protected static $supportedFeatureSetVersion = 304;
    34+
    3335
    protected function setUp()
    3436
    {
    3537
    parent::setUp();

    src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -95,7 +95,7 @@ public function build(ContainerBuilder $container)
    9595
    // but as late as possible to get resolved parameters
    9696
    $container->addCompilerPass((new RegisterListenersPass())->setHotPathEvents($hotPathEvents), PassConfig::TYPE_BEFORE_REMOVING);
    9797
    $container->addCompilerPass(new TemplatingPass());
    98-
    $this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class, PassConfig::TYPE_BEFORE_REMOVING);
    98+
    $this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class);
    9999
    $container->addCompilerPass(new AddAnnotationsCachedReaderPass(), PassConfig::TYPE_AFTER_REMOVING, -255);
    100100
    $this->addCompilerPassIfExists($container, AddValidatorInitializersPass::class);
    101101
    $this->addCompilerPassIfExists($container, AddConsoleCommandPass::class, PassConfig::TYPE_BEFORE_REMOVING);

    src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -27,6 +27,8 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
    2727
    */
    2828
    protected $engine;
    2929

    30+
    protected static $supportedFeatureSetVersion = 304;
    31+
    3032
    protected function getExtensions()
    3133
    {
    3234
    // should be moved to the Form component once absolute file paths are supported

    src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -27,6 +27,8 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
    2727
    */
    2828
    protected $engine;
    2929

    30+
    protected static $supportedFeatureSetVersion = 304;
    31+
    3032
    public function testStartTagHasNoActionAttributeWhenActionIsEmpty()
    3133
    {
    3234
    $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [

    src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -58,7 +58,7 @@ public function transform($value)
    5858
    if (!is_numeric($value)) {
    5959
    throw new TransformationFailedException('Expected a numeric.');
    6060
    }
    61-
    $value = (string) ($value / $this->divisor);
    61+
    $value /= $this->divisor;
    6262
    }
    6363

    6464
    return parent::transform($value);

    src/Symfony/Component/Form/Test/FormPerformanceTestCase.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Component\Form\Test;
    1313

    14+
    use Symfony\Component\Form\Tests\VersionAwareTest;
    15+
    1416
    /**
    1517
    * Base class for performance tests.
    1618
    *
    @@ -21,6 +23,8 @@
    2123
    */
    2224
    abstract class FormPerformanceTestCase extends FormIntegrationTestCase
    2325
    {
    26+
    use VersionAwareTest;
    27+
    2428
    /**
    2529
    * @var int
    2630
    */

    src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -19,6 +19,8 @@
    1919

    2020
    abstract class AbstractLayoutTest extends FormIntegrationTestCase
    2121
    {
    22+
    use VersionAwareTest;
    23+
    2224
    protected $csrfTokenManager;
    2325
    protected $testableFeatures = [];
    2426

    src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php

    Lines changed: 25 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -17,6 +17,18 @@
    1717

    1818
    class MoneyToLocalizedStringTransformerTest extends TestCase
    1919
    {
    20+
    private $previousLocale;
    21+
    22+
    protected function setUp()
    23+
    {
    24+
    $this->previousLocale = setlocale(LC_ALL, '0');
    25+
    }
    26+
    27+
    protected function tearDown()
    28+
    {
    29+
    setlocale(LC_ALL, $this->previousLocale);
    30+
    }
    31+
    2032
    public function testTransform()
    2133
    {
    2234
    // Since we test against "de_AT", we need the full implementation
    @@ -73,7 +85,7 @@ public function testReverseTransformEmpty()
    7385
    $this->assertNull($transformer->reverseTransform(''));
    7486
    }
    7587

    76-
    public function testFloatToIntConversionMismatchOnReversTransform()
    88+
    public function testFloatToIntConversionMismatchOnReverseTransform()
    7789
    {
    7890
    $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100);
    7991
    IntlTestHelper::requireFullIntl($this, false);
    @@ -90,4 +102,16 @@ public function testFloatToIntConversionMismatchOnTransform()
    90102

    91103
    $this->assertSame('10,20', $transformer->transform(1020));
    92104
    }
    105+
    106+
    public function testValidNumericValuesWithNonDotDecimalPointCharacter()
    107+
    {
    108+
    // calling setlocale() here is important as it changes the representation of floats when being cast to strings
    109+
    setlocale(LC_ALL, 'de_AT.UTF-8');
    110+
    111+
    $transformer = new MoneyToLocalizedStringTransformer(4, null, null, 100);
    112+
    IntlTestHelper::requireFullIntl($this, false);
    113+
    \Locale::setDefault('de_AT');
    114+
    115+
    $this->assertSame('0,0035', $transformer->transform(12 / 34));
    116+
    }
    93117
    }

    src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php

    Lines changed: 3 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -12,12 +12,15 @@
    1212
    namespace Symfony\Component\Form\Tests\Extension\Core\Type;
    1313

    1414
    use Symfony\Component\Form\Test\TypeTestCase;
    15+
    use Symfony\Component\Form\Tests\VersionAwareTest;
    1516

    1617
    /**
    1718
    * @author Bernhard Schussek <bschussek@gmail.com>
    1819
    */
    1920
    abstract class BaseTypeTest extends TypeTestCase
    2021
    {
    22+
    use VersionAwareTest;
    23+
    2124
    const TESTED_TYPE = '';
    2225

    2326
    public function testPassDisabledAsOption()
    Lines changed: 27 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -0,0 +1,27 @@
    1+
    <?php
    2+
    3+
    /*
    4+
    * This file is part of the Symfony package.
    5+
    *
    6+
    * (c) Fabien Potencier <fabien@symfony.com>
    7+
    *
    8+
    * For the full copyright and license information, please view the LICENSE
    9+
    * file that was distributed with this source code.
    10+
    */
    11+
    12+
    namespace Symfony\Component\Form\Tests;
    13+
    14+
    trait VersionAwareTest
    15+
    {
    16+
    protected static $supportedFeatureSetVersion = 304;
    17+
    18+
    /**
    19+
    * @param int $requiredFeatureSetVersion
    20+
    */
    21+
    protected function requiresFeatureSet($requiredFeatureSetVersion)
    22+
    {
    23+
    if ($requiredFeatureSetVersion > static::$supportedFeatureSetVersion) {
    24+
    $this->markTestSkipped(sprintf('Test requires features from symfony/form %.2f but only version %.2f is supported.', $requiredFeatureSetVersion / 100, static::$supportedFeatureSetVersion / 100));
    25+
    }
    26+
    }
    27+
    }

    src/Symfony/Component/Validator/Resources/translations/validators.bg.xlf

    Lines changed: 16 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -318,6 +318,22 @@
    318318
    <source>Error</source>
    319319
    <target>Грешка</target>
    320320
    </trans-unit>
    321+
    <trans-unit id="83">
    322+
    <source>This is not a valid UUID.</source>
    323+
    <target>Това не е валиден UUID.</target>
    324+
    </trans-unit>
    325+
    <trans-unit id="84">
    326+
    <source>This value should be a multiple of {{ compared_value }}.</source>
    327+
    <target>Тази стойност трябва да бъде кратно число на {{ compared_value }}.</target>
    328+
    </trans-unit>
    329+
    <trans-unit id="85">
    330+
    <source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
    331+
    <target>Този бизнес идентификационен код (BIC) не е свързана с IBAN {{ iban }}.</target>
    332+
    </trans-unit>
    333+
    <trans-unit id="86">
    334+
    <source>This value should be valid JSON.</source>
    335+
    <target>Тази стойност трябва да е валидна JSON.</target>
    336+
    </trans-unit>
    321337
    </body>
    322338
    </file>
    323339
    </xliff>

    src/Symfony/Component/Validator/Resources/translations/validators.ca.xlf

    Lines ch 10000 anged: 24 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -301,11 +301,35 @@
    301301
    <trans-unit id="78">
    302302
    <source>An empty file is not allowed.</source>
    303303
    <target>No està permès un fixter buit.</target>
    304+
    </trans-unit>
    305+
    <trans-unit id="79">
    306+
    <source>The host could not be resolved.</source>
    307+
    <target>No s'ha pogut resoldre l'amfitrió.</target>
    308+
    </trans-unit>
    309+
    <trans-unit id="80">
    310+
    <source>This value does not match the expected {{ charset }} charset.</source>
    311+
    <target>Aquest valor no coincideix amb l'esperat {{ charset }} joc de caràcters.</target>
    312+
    </trans-unit>
    313+
    <trans-unit id="81">
    314+
    <source>This is not a valid Business Identifier Code (BIC).</source>
    315+
    <target>Aquest no és un codi d'identificació bancari (BIC) vàlid.</target>
    316+
    </trans-unit>
    317+
    <trans-unit id="82">
    318+
    <source>Error</source>
    319+
    <target>Error</target>
    304320
    </trans-unit>
    305321
    <trans-unit id="83">
    306322
    <source>This is not a valid UUID.</source>
    307323
    <target>Aquest valor no és un UUID vàlid.</target>
    308324
    </trans-unit>
    325+
    <trans-unit id="84">
    326+
    <source>This value should be a multiple of {{ compared_value }}.</source>
    327+
    <target>Aquest valor ha de ser múltiple de {{ compared_value }}.</target>
    328+
    </trans-unit>
    329+
    <trans-unit id="85">
    330+
    <source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
    331+
    <target>Aquest Codi d'identificació bancari (BIC) no està associat amb l'IBAN {{ iban }}.</target>
    332+
    </trans-unit>
    309333
    </body>
    310334
    </file>
    311335
    </xliff>

    src/Symfony/Component/Validator/Resources/translations/validators.en.xlf

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -330,6 +330,10 @@
    330330
    <source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
    331331
    <target>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</target>
    332332
    </trans-unit>
    333+
    <trans-unit id="86">
    334+
    <source>This value should be valid JSON.</source>
    335+
    <target>This value should be valid JSON.</target>
    336+
    </trans-unit>
    333337
    </body>
    334338
    </file>
    335339
    </xliff>

    src/Symfony/Component/Validator/Resources/translations/validators.es.xlf

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -324,7 +324,7 @@
    324324
    </trans-unit>
    325325
    <trans-unit id="84">
    326326
    <source>This value should be a multiple of {{ compared_value }}.</source>
    327-
    <target>Este valor debería ser un múltiplo de {{ compared_value }}.</target>
    327+
    <target>Este valor debería ser múltiplo de {{ compared_value }}.</target>
    328328
    </trans-unit>
    329329
    <trans-unit id="85">
    330330
    <source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>

    src/Symfony/Component/Validator/Resources/translations/validators.eu.xlf

    Lines changed: 44 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -278,6 +278,42 @@
    278278
    <source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
    279279
    <target>Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar.</target>
    280280
    </trans-unit>
    281+
    <trans-unit id="73">
    282+
    <source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
    283+
    <target>Irudiaren proportzioa oso handia da ({{ ratio }}). Onartutako proportzio handienda {{ max_ratio }} da.</target>
    284+
    </trans-unit>
    285+
    <trans-unit id="74">
    286+
    <source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
    287+
    <target>Irudiaren proportzioa oso txikia da ({{ ratio }}). Onartutako proportzio txikiena {{ min_ratio }} da.</target>
    288+
    </trans-unit>
    289+
    <trans-unit id="75">
    290+
    <source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
    291+
    <target>Irudia karratua da ({{ width }}x{{ height }}px). Karratuak diren irudiak ez dira onartzen.</target>
    292+
    </trans-unit>
    293+
    <trans-unit id="76">
    294+
    <source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
    295+
    <target>Irudia horizontalki bideratua dago ({{ width }}x{{ height }}px). Horizontalki bideratutako irudiak ez dira onartzen.</target>
    296+
    </trans-unit>
    297+
    <trans-unit id="77">
    298+
    <source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
    299+
    <target>Irudia bertikalki bideratua dago ({{ width }}x{{ height }}px). Bertikalki bideratutako irudiak ez dira onartzen.</target>
    300+
    </trans-unit>
    301+
    <trans-unit id="78">
    302+
    <source>An empty file is not allowed.</source>
    303+
    <target>Hutsik dagoen fitxategia ez da onartzen.</target>
    304+
    </trans-unit>
    305+
    <trans-unit id="79">
    306+
    <source>The host could not be resolved.</source>
    307+
    <target>Host-a ezin da ebatzi.</target>
    308+
    </trans-unit>
    309+
    <trans-unit id="80">
    310+
    <source>This value does not match the expected {{ charset }} charset.</source>
    311+
    <target>Balio honen karaktere kodea ez da esperotakoa {{ charset }}.</target>
    312+
    </trans-unit>
    313+
    <trans-unit id="81">
    314+
    <source>This is not a valid Business Identifier Code (BIC).</source>
    315+
    <target>Ez da balizko Banku Identifikazioko Kodea (BIC).</target>
    316+
    </trans-unit>
    281317
    <trans-unit id="82">
    282318
    <source>Error</source>
    283319
    <target>Errore</target>
    @@ -286,6 +322,14 @@
    286322
    <source>This is not a valid UUID.</source>
    287323
    <target>Balio hau ez da onartutako UUID bat.</target>
    288324
    </trans-unit>
    325+
    <trans-unit id="84">
    326+
    <source>This value should be a multiple of {{ compared_value }}.</source>
    327+
    <target>Balio honek {{ compared_value }}-ren multiploa izan beharko luke.</target>
    328+
    </trans-unit>
    329+
    <trans-unit id="85">
    330+
    <source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
    331+
    <target>Banku Identifikazioko Kode hau ez dago lotuta {{ IBAN }} IBAN-rekin.</target>
    332+
    </trans-unit>
    289333
    </body>
    290334
    </file>
    291335
    </xliff>

    src/Symfony/Component/Validator/Resources/translations/validators.fa.xlf

    Lines changed: 52 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -278,6 +278,58 @@
    278278
    <source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
    279279
    <target>این مقدار نباید {{ compared_value_type }} {{ compared_value }} یکی باشد.</target>
    280280
    </trans-unit>
    281+
    <trans-unit id="73">
    282+
    <source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
    283+
    <target>ابعاد {{ ratio }} عکس بیش از حد بزرگ است.حداکثر ابعاد مجاز {{ max_ratio }} است.</target>
    284+
    </trans-unit>
    285+
    <trans-unit id="74">
    286+
    <source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
    287+
    <target>ابعاد {{ ratio }} عکس بیش از حد کوچک است.حداقل ابعاد مجاز {{ min_ratio }} است.</target>
    288+
    </trans-unit>
    289+
    <trans-unit id="75">
    290+
    <source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
    291+
    <target>این عکس مربع width }}x{{ height }}px}} می باشد.عکس مربع مجاز نمی باشد.</target>
    292+
    </trans-unit>
    293+
    <trans-unit id="76">
    294+
    <source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
    295+
    <target>این عکس افقی width }}x{{ height }}px}} می باشد.عکس افقی مجاز نمی باشد.</target>
    296+
    </trans-unit>
    297+
    <trans-unit id="77">
    298+
    <source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
    299+
    <target>این عکس عمودی width }}x{{ height }}px}} می باشد.عکس عمودی مجاز نمی باشد.</target>
    300+
    </trans-unit>
    301+
    <trans-unit id="78">
    302+
    <source>An empty file is not allowed.</source>
    303+
    <target>فایل خالی مجاز نمی باشد.</target>
    304+
    </trans-unit>
    305+
    <trans-unit id="79">
    306+
    <source>The host could not be resolved.</source>
    307+
    <target>هاست قابل حل نیست.</target>
    308+
    </trans-unit>
    309+
    <trans-unit id="80">
    310+
    <source>This value does not match the expected {{ charset }} charset.</source>
    311+
    <target>این مقدار مورد نظر نمی باشد. مقدار مورد نظر {{ charset }} می باشد.</target>
    312+
    </trans-unit>
    313+
    <trans-unit id="81">
    314+
    <source>This is not a valid Business Identifier Code (BIC).</source>
    315+
    <target>این مقدار یک BIC درست نیست.</target>
    316+
    </trans-unit>
    317+
    <trans-unit id="82">
    318+
    <source>Error</source>
    319+
    <target>خطا</target>
    320+
    </trans-unit>
    321+
    <trans-unit id="83">
    322+
    <source>This is not a valid UUID.</source>
    323+
    <target>این مقدار یک UUID درست نیست.</target>
    324+
    </trans-unit>
    325+
    <trans-unit id="84">
    326+
    <source>This value should be a multiple of {{ compared_value }}.</source>
    327+
    <target>این مقدار باید چند برابر {{ compared_value }} باشد.</target>
    328+
    </trans-unit>
    329+
    <trans-unit id="85">
    330+
    <source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
    331+
    <target>این BIC با IBAN ارتباط ندارد.</target>
    332+
    </trans-unit>
    281333
    </body>
    282334
    </file>
    283335
    </xliff>

    0 commit comments

    Comments
     (0)
    0