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
This commit is contained in:
Christian Flothmann 2019-02-14 16:32:36 +01:00
commit c58d4c2e22
23 changed files with 343 additions and 5 deletions

View File

@ -30,6 +30,8 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
*/
private $em;
protected static $supportedFeatureSetVersion = 304;
protected function getExtensions()
{
$manager = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();

View File

@ -57,6 +57,8 @@ class EntityTypeTest extends BaseTypeTest
*/
private $emRegistry;
protected static $supportedFeatureSetVersion = 304;
protected function setUp()
{
$this->em = DoctrineTestHelper::createTestEntityManager();

View File

@ -16,6 +16,8 @@ use Symfony\Component\Form\Tests\AbstractLayoutTest;
abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
{
protected static $supportedFeatureSetVersion = 304;
public function testLabelOnForm()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType');

View File

@ -31,6 +31,8 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
*/
private $renderer;
protected static $supportedFeatureSetVersion = 304;
protected function setUp()
{
parent::setUp();

View File

@ -30,6 +30,8 @@ class FormExtensionTableLayoutTest extends AbstractTableLayoutTest
*/
private $renderer;
protected static $supportedFeatureSetVersion = 304;
protected function setUp()
{
parent::setUp();

View File

@ -95,7 +95,7 @@ class FrameworkBundle extends Bundle
// but as late as possible to get resolved parameters
$container->addCompilerPass((new RegisterListenersPass())->setHotPathEvents($hotPathEvents), PassConfig::TYPE_BEFORE_REMOVING);
$container->addCompilerPass(new TemplatingPass());
$this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class, PassConfig::TYPE_BEFORE_REMOVING);
$this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class);
$container->addCompilerPass(new AddAnnotationsCachedReaderPass(), PassConfig::TYPE_AFTER_REMOVING, -255);
$this->addCompilerPassIfExists($container, AddValidatorInitializersPass::class);
$this->addCompilerPassIfExists($container, AddConsoleCommandPass::class, PassConfig::TYPE_BEFORE_REMOVING);

View File

@ -27,6 +27,8 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
*/
protected $engine;
protected static $supportedFeatureSetVersion = 304;
protected function getExtensions()
{
// should be moved to the Form component once absolute file paths are supported

View File

@ -27,6 +27,8 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
*/
protected $engine;
protected static $supportedFeatureSetVersion = 304;
public function testStartTagHasNoActionAttributeWhenActionIsEmpty()
{
$form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\FormType', null, [

View File

@ -58,7 +58,7 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform
if (!is_numeric($value)) {
throw new TransformationFailedException('Expected a numeric.');
}
$value = (string) ($value / $this->divisor);
$value /= $this->divisor;
}
return parent::transform($value);

View File

@ -11,6 +11,8 @@
namespace Symfony\Component\Form\Test;
use Symfony\Component\Form\Tests\VersionAwareTest;
/**
* Base class for performance tests.
*
@ -21,6 +23,8 @@ namespace Symfony\Component\Form\Test;
*/
abstract class FormPerformanceTestCase extends FormIntegrationTestCase
{
use VersionAwareTest;
/**
* @var int
*/

View File

@ -19,6 +19,8 @@ use Symfony\Component\Form\Test\FormIntegrationTestCase;
abstract class AbstractLayoutTest extends FormIntegrationTestCase
{
use VersionAwareTest;
protected $csrfTokenManager;
protected $testableFeatures = [];

View File

@ -17,6 +17,18 @@ use Symfony\Component\Intl\Util\IntlTestHelper;
class MoneyToLocalizedStringTransformerTest extends TestCase
{
private $previousLocale;
protected function setUp()
{
$this->previousLocale = setlocale(LC_ALL, '0');
}
protected function tearDown()
{
setlocale(LC_ALL, $this->previousLocale);
}
public function testTransform()
{
// Since we test against "de_AT", we need the full implementation
@ -73,7 +85,7 @@ class MoneyToLocalizedStringTransformerTest extends TestCase
$this->assertNull($transformer->reverseTransform(''));
}
public function testFloatToIntConversionMismatchOnReversTransform()
public function testFloatToIntConversionMismatchOnReverseTransform()
{
$transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100);
IntlTestHelper::requireFullIntl($this, false);
@ -90,4 +102,16 @@ class MoneyToLocalizedStringTransformerTest extends TestCase
$this->assertSame('10,20', $transformer->transform(1020));
}
public function testValidNumericValuesWithNonDotDecimalPointCharacter()
{
// calling setlocale() here is important as it changes the representation of floats when being cast to strings
setlocale(LC_ALL, 'de_AT.UTF-8');
$transformer = new MoneyToLocalizedStringTransformer(4, null, null, 100);
IntlTestHelper::requireFullIntl($this, false);
\Locale::setDefault('de_AT');
$this->assertSame('0,0035', $transformer->transform(12 / 34));
}
}

View File

@ -12,12 +12,15 @@
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
use Symfony\Component\Form\Test\TypeTestCase;
use Symfony\Component\Form\Tests\VersionAwareTest;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class BaseTypeTest extends TypeTestCase
{
use VersionAwareTest;
const TESTED_TYPE = '';
public function testPassDisabledAsOption()

View File

@ -0,0 +1,27 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Tests;
trait VersionAwareTest
{
protected static $supportedFeatureSetVersion = 304;
/**
* @param int $requiredFeatureSetVersion
*/
protected function requiresFeatureSet($requiredFeatureSetVersion)
{
if ($requiredFeatureSetVersion > static::$supportedFeatureSetVersion) {
$this->markTestSkipped(sprintf('Test requires features from symfony/form %.2f but only version %.2f is supported.', $requiredFeatureSetVersion / 100, static::$supportedFeatureSetVersion / 100));
}
}
}

View File

@ -318,6 +318,22 @@
<source>Error</source>
<target>Грешка</target>
</trans-unit>
<trans-unit id="83">
<source>This is not a valid UUID.</source>
<target>Това не е валиден UUID.</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Тази стойност трябва да бъде кратно число на {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>Този бизнес идентификационен код (BIC) не е свързана с IBAN {{ iban }}.</target>
</trans-unit>
<trans-unit id="86">
<source>This value should be valid JSON.</source>
<target>Тази стойност трябва да е валидна JSON.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -301,11 +301,35 @@
<trans-unit id="78">
<source>An empty file is not allowed.</source>
<target>No està permès un fixter buit.</target>
</trans-unit>
<trans-unit id="79">
<source>The host could not be resolved.</source>
<target>No s'ha pogut resoldre l'amfitrió.</target>
</trans-unit>
<trans-unit id="80">
<source>This value does not match the expected {{ charset }} charset.</source>
<target>Aquest valor no coincideix amb l'esperat {{ charset }} joc de caràcters.</target>
</trans-unit>
<trans-unit id="81">
<source>This is not a valid Business Identifier Code (BIC).</source>
<target>Aquest no és un codi d'identificació bancari (BIC) vàlid.</target>
</trans-unit>
<trans-unit id="82">
<source>Error</source>
<target>Error</target>
</trans-unit>
<trans-unit id="83">
<source>This is not a valid UUID.</source>
<target>Aquest valor no és un UUID vàlid.</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Aquest valor ha de ser múltiple de {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>Aquest Codi d'identificació bancari (BIC) no està associat amb l'IBAN {{ iban }}.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -330,6 +330,10 @@
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</target>
</trans-unit>
<trans-unit id="86">
<source>This value should be valid JSON.</source>
<target>This value should be valid JSON.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -324,7 +324,7 @@
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Este valor debería ser un múltiplo de {{ compared_value }}.</target>
<target>Este valor debería ser múltiplo de {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>

View File

@ -278,6 +278,42 @@
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Balio hau ez litzateke {{ compared_value_type }} {{ compared_value }}-(r)en berbera izan behar.</target>
</trans-unit>
<trans-unit id="73">
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
<target>Irudiaren proportzioa oso handia da ({{ ratio }}). Onartutako proportzio handienda {{ max_ratio }} da.</target>
</trans-unit>
<trans-unit id="74">
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
<target>Irudiaren proportzioa oso txikia da ({{ ratio }}). Onartutako proportzio txikiena {{ min_ratio }} da.</target>
</trans-unit>
<trans-unit id="75">
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
<target>Irudia karratua da ({{ width }}x{{ height }}px). Karratuak diren irudiak ez dira onartzen.</target>
</trans-unit>
<trans-unit id="76">
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
<target>Irudia horizontalki bideratua dago ({{ width }}x{{ height }}px). Horizontalki bideratutako irudiak ez dira onartzen.</target>
</trans-unit>
<trans-unit id="77">
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
<target>Irudia bertikalki bideratua dago ({{ width }}x{{ height }}px). Bertikalki bideratutako irudiak ez dira onartzen.</target>
</trans-unit>
<trans-unit id="78">
<source>An empty file is not allowed.</source>
<target>Hutsik dagoen fitxategia ez da onartzen.</target>
</trans-unit>
<trans-unit id="79">
<source>The host could not be resolved.</source>
<target>Host-a ezin da ebatzi.</target>
</trans-unit>
<trans-unit id="80">
<source>This value does not match the expected {{ charset }} charset.</source>
<target>Balio honen karaktere kodea ez da esperotakoa {{ charset }}.</target>
</trans-unit>
<trans-unit id="81">
<source>This is not a valid Business Identifier Code (BIC).</source>
<target>Ez da balizko Banku Identifikazioko Kodea (BIC).</target>
</trans-unit>
<trans-unit id="82">
<source>Error</source>
<target>Errore</target>
@ -286,6 +322,14 @@
<source>This is not a valid UUID.</source>
<target>Balio hau ez da onartutako UUID bat.</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Balio honek {{ compared_value }}-ren multiploa izan beharko luke.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>Banku Identifikazioko Kode hau ez dago lotuta {{ IBAN }} IBAN-rekin.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -278,6 +278,58 @@
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>این مقدار نباید {{ compared_value_type }} {{ compared_value }} یکی باشد.</target>
</trans-unit>
<trans-unit id="73">
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
<target>ابعاد {{ ratio }} عکس بیش از حد بزرگ است.حداکثر ابعاد مجاز {{ max_ratio }} است.</target>
</trans-unit>
<trans-unit id="74">
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
<target>ابعاد {{ ratio }} عکس بیش از حد کوچک است.حداقل ابعاد مجاز {{ min_ratio }} است.</target>
</trans-unit>
<trans-unit id="75">
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
<target>این عکس مربع width }}x{{ height }}px}} می باشد.عکس مربع مجاز نمی باشد.</target>
</trans-unit>
<trans-unit id="76">
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
<target>این عکس افقی width }}x{{ height }}px}} می باشد.عکس افقی مجاز نمی باشد.</target>
</trans-unit>
<trans-unit id="77">
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
<target>این عکس عمودی width }}x{{ height }}px}} می باشد.عکس عمودی مجاز نمی باشد.</target>
</trans-unit>
<trans-unit id="78">
<source>An empty file is not allowed.</source>
<target>فایل خالی مجاز نمی باشد.</target>
</trans-unit>
<trans-unit id="79">
<source>The host could not be resolved.</source>
<target>هاست قابل حل نیست.</target>
</trans-unit>
<trans-unit id="80">
<source>This value does not match the expected {{ charset }} charset.</source>
<target>این مقدار مورد نظر نمی باشد. مقدار مورد نظر {{ charset }} می باشد.</target>
</trans-unit>
<trans-unit id="81">
<source>This is not a valid Business Identifier Code (BIC).</source>
<target>این مقدار یک BIC درست نیست.</target>
</trans-unit>
<trans-unit id="82">
<source>Error</source>
<target>خطا</target>
</trans-unit>
<trans-unit id="83">
<source>This is not a valid UUID.</source>
<target>این مقدار یک UUID درست نیست.</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>این مقدار باید چند برابر {{ compared_value }} باشد.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>این BIC با IBAN ارتباط ندارد.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -330,6 +330,10 @@
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>Ce code d'identification d'entreprise (BIC) n'est pas associé à l'IBAN {{ iban }}.</target>
</trans-unit>
<trans-unit id="86">
<source>This value should be valid JSON.</source>
<target>Cette valeur doit être un JSON valide.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -208,7 +208,7 @@
</trans-unit>
<trans-unit id="55">
<source>This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.</source>
<target>Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente.|Ky kolekcion duhet të përmbajë {{ limit }} ose më shumë elemente.</target>
<target>Ky kolekcion duhet të përmbajë {{ limit }} ose më pak elemente.|Ky kolekcion duhet të përmbajë {{ limit }} ose më pak elemente.</target>
</trans-unit>
<trans-unit id="56">
<source>This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.</source>
@ -222,6 +222,114 @@
<source>Unsupported card type or invalid card number.</source>
<target>Lloj kartele i pambështetur ose numër kartele i pavlefshëm.</target>
</trans-unit>
<trans-unit id="59">
<source>This is not a valid International Bank Account Number (IBAN).</source>
<target>Ky nuk është një numër i vlefshëm ndërkombëtar i llogarisë bankare (IBAN).</target>
</trans-unit>
<trans-unit id="60">
<source>This value is not a valid ISBN-10.</source>
<target>Kjo vlerë nuk është një ISBN-10 e vlefshme.</target>
</trans-unit>
<trans-unit id="61">
<source>This value is not a valid ISBN-13.</source>
<target>Kjo vlerë nuk është një ISBN-13 e vlefshme.</target>
</trans-unit>
<trans-unit id="62">
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
<target>Kjo vlerë nuk është as ISBN-10 e vlefshme as ISBN-13 e vlefshme.</target>
</trans-unit>
<trans-unit id="63">
<source>This value is not a valid ISSN.</source>
<target>Kjo vlerë nuk është një ISSN e vlefshme.</target>
</trans-unit>
<trans-unit id="64">
<source>This value is not a valid currency.</source>
<target>Kjo vlerë nuk është një monedhë e vlefshme.</target>
</trans-unit>
<trans-unit id="65">
<source>This value should be equal to {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë e barabartë me {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="66">
<source>This value should be greater than {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë më e madhe se {{ compared_value }}. </target>
</trans-unit>
<trans-unit id="67">
<source>This value should be greater than or equal to {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë më e madhe ose e barabartë me {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="68">
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë identike me {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="69">
<source>This value should be less than {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë më vogël se {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="70">
<source>This value should be less than or equal to {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë më e vogël ose e barabartë me {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="71">
<source>This value should not be equal to {{ compared_value }}.</source>
<target>Kjo vlerë nuk duhet të jetë e barabartë me {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="72">
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Kjo vlerë nuk duhet të jetë identike me {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="73">
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
<target>Raporti i imazhit është shumë i madh ({{ ratio }}). Raporti maksimal i lejuar është {{ max_ratio }}.</target>
</trans-unit>
<trans-unit id="74">
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
<target>Raporti i imazhit është shumë i vogël ({{ ratio }}). Raporti minimal pritet të jetë {{ min_ratio }}.</target>
</trans-unit>
<trans-unit id="75">
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
<target>Imazhi është katror ({{ width }}x{{ height }}px). Imazhet katrore nuk janë të lejuara.</target>
</trans-unit>
<trans-unit id="76">
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
<target>Imazhi është i orientuar nga landscape ({{ width }}x{{ height }}px). Imazhet e orientuara nga landscape nuk lejohen.</target>
</trans-unit>
<trans-unit id="77">
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
<target>Imazhi është portret i orientuar ({{ width }}x{{ height }}px). Imazhet orientuese të portretit nuk lejohen.</target>
</trans-unit>
<trans-unit id="78">
<source>An empty file is not allowed.</source>
<target>Një file i zbrazët nuk lejohet.</target>
</trans-unit>
<trans-unit id="79">
<source>The host could not be resolved.</source>
<target>Probleme me Host</target>
</trans-unit>
<trans-unit id="80">
<source>This value does not match the expected {{ charset }} charset.</source>
<target>Kjo vlerë nuk përputhet me karakteret {{ charset }} e pritura.</target>
</trans-unit>
<trans-unit id="81">
<source>This is not a valid Business Identifier Code (BIC).</source>
<target>Ky nuk është një Kod i Identifikueshëm i Biznesit (BIC).</target>
</trans-unit>
<trans-unit id="82">
<source>Error</source>
<target>Gabim</target>
</trans-unit>
<trans-unit id="83">
<source>This is not a valid UUID.</source>
<target>Kjo nuk është një UUID e vlefshme.</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Kjo vlerë duhet të jetë një shumëfish i {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>Ky Kod Identifikues i Biznesit (BIC) nuk është i lidhur me IBAN {{ iban }}.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -318,6 +318,18 @@
<source>Error</source>
<target>Помилка</target>
</trans-unit>
<trans-unit id="83">
<source>This is not a valid UUID.</source>
<target>Це не валідне значення UUID.</target>
</trans-unit>
<trans-unit id="84">
<source>This value should be a multiple of {{ compared_value }}.</source>
<target>Це значення повинне бути кратним {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="85">
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
<target>Банківський код (BIC) не пов’язаний із міжнародним номером банківського рахунку (IBAN) {{ iban }}.</target>
</trans-unit>
</body>
</file>
</xliff>