Skip to content

Commit 0beaf9d

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: Fix and add test [Validator] updated Macedonian translation [Validator] updated Portuguese translation
2 parents 3a0bd83 + 1eab442 commit 0beaf9d

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,10 @@
426426
<source>Using hidden overlay characters is not allowed.</source>
427427
<target>Не е дозволено користење на скриени знаци за преклопување.</target>
428428
</trans-unit>
429+
<trans-unit id="110">
430+
<source>The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}.</source>
431+
<target>Зголемувања на датотеката е неважечка ({{ extension }}). Дозволени зголемувања се ({{ extensions }}).</target>
432+
</trans-unit>
429433
</body>
430434
</file>
431435
</xliff>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,10 @@
426426
<source>Using hidden overlay characters is not allowed.</source>
427427
<target>Não é permitido usar caracteres de sobreposição ocultos.</target>
428428
</trans-unit>
429+
<trans-unit id="110">
430+
<source>The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}.</source>
431+
<target>A extensão do ficheiro é inválida ({{ extension }}). As extensões permitidas são {{ extensions }}.</target>
432+
</trans-unit>
429433
</body>
430434
</file>
431435
</xliff>

src/Symfony/Component/Validator/Tests/Constraints/CssColorValidatorTest.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,22 @@ public function getInvalidHSLA(): array
418418
return [['hsla(1000, 1000%, 20000%, 999)'], ['hsla(-100, -10%, -2%, 999)'], ['hsla(a, b, c, d)'], ['hsla(a, b%, c%, d)'], ['hsla( 9 99% , 99 9% , 9 %']];
419419
}
420420

421-
public function testUnknownFormatsOnValidateTriggerException()
421+
/**
422+
* @dataProvider getInvalidFormats
423+
*/
424+
public function testUnknownFormatAsStringThrowsException($formats)
422425
{
423426
$this->expectException(\InvalidArgumentException::class);
424427
$this->expectExceptionMessage('The "formats" parameter value is not valid. It must contain one or more of the following values: "hex_long, hex_long_with_alpha, hex_short, hex_short_with_alpha, basic_named_colors, extended_named_colors, system_colors, keywords, rgb, rgba, hsl, hsla".');
425-
$constraint = new CssColor('Unknown Format');
426-
$this->validator->validate('#F4B907', $constraint);
428+
429+
new CssColor($formats);
430+
}
431+
432+
public static function getInvalidFormats(): array
433+
{
434+
return [
435+
'as string' => ['Unknown Format'],
436+
'as array' => [['Unknown Format']],
437+
];
427438
}
428439
}

src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTestCase.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,9 @@ public function testMaxSizeNotExceeded($bytesWritten, $limit)
235235
public function testInvalidMaxSize()
236236
{
237237
$this->expectException(ConstraintDefinitionException::class);
238-
$constraint = new File([
238+
new File([
239239
'maxSize' => '1abc',
240240
]);
241-
242-
$this->validator->validate($this->path, $constraint);
243241
}
244242

245243
public static function provideBinaryFormatTests()

0 commit comments

Comments
 (0)