Skip to content

Commit 1be7d1d

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: (21 commits) [SecurityBundle] Add `provider` XML attribute to the authenticators it’s missing from [DoctrineBridge] Test reset with a true manager Sync php-cs-fixer config file with 7.2 [HttpClient] Fix parsing SSE [Notifier] Fix thread key in GoogleChat bridge [HttpKernel][Security] Fix accessing session for stateless request [Serializer] Fix `ObjectNormalizer` with property path test handling of special "value" constraint option [PhpUnitBridge] Add missing import [FrameworkBundle] Fix setting default context for certain normalizers [57251] Missing translations for Romanian (ro) [ErrorHandler] Fix rendered exception code highlighting on PHP 8.3 [String] Fix #54611 pluralization of -on ending words + singularization of -a ending foreign words [Validator] [UniqueValidator] Use correct variable as parameter in (custom) error message [Messenger] Comply with Amazon SQS requirements for message body fix cssColor HSLA test dataProvider properly handle invalid data for false/true types chore: upgrade class doc add space in error message [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message. ...
2 parents dab2781 + e00b254 commit 1be7d1d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Constraints/UniqueValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function validate(mixed $value, Constraint $constraint)
5151

5252
if (\in_array($element, $collectionElements, true)) {
5353
$this->context->buildViolation($constraint->message)
54-
->setParameter('{{ value }}', $this->formatValue($value))
54+
->setParameter('{{ value }}', $this->formatValue($element))
5555
->setCode(Unique::IS_NOT_UNIQUE)
5656
->addViolation();
5757

Resources/translations/validators.ro.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@
440440
</trans-unit>
441441
<trans-unit id="113">
442442
<source>This URL is missing a top-level domain.</source>
443-
<target state="needs-review-translation">Acest URL îi lipsește un domeniu de nivel superior.</target>
443+
<target>Acestui URL îi lipsește un domeniu de nivel superior.</target>
444444
</trans-unit>
445445
</body>
446446
</file>

Tests/Constraints/CssColorValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public static function getInvalidHSL(): array
396396
}
397397

398398
/**
399-
* @dataProvider getInvalidHSL
399+
* @dataProvider getInvalidHSLA
400400
*/
401401
public function testInvalidHSLA($cssColor)
402402
{

Tests/Constraints/UniqueValidatorTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ public static function getValidValues()
6161
/**
6262
* @dataProvider getInvalidValues
6363
*/
64-
public function testInvalidValues($value)
64+
public function testInvalidValues($value, $expectedMessageParam)
6565
{
6666
$constraint = new Unique([
6767
'message' => 'myMessage',
6868
]);
6969
$this->validator->validate($value, $constraint);
7070

7171
$this->buildViolation('myMessage')
72-
->setParameter('{{ value }}', 'array')
72+
->setParameter('{{ value }}', $expectedMessageParam)
7373
->setCode(Unique::IS_NOT_UNIQUE)
7474
->assertRaised();
7575
}
@@ -79,12 +79,12 @@ public static function getInvalidValues()
7979
$object = new \stdClass();
8080

8181
return [
82-
yield 'not unique booleans' => [[true, true]],
83-
yield 'not unique integers' => [[1, 2, 3, 3]],
84-
yield 'not unique floats' => [[0.1, 0.2, 0.1]],
85-
yield 'not unique string' => [['a', 'b', 'a']],
86-
yield 'not unique arrays' => [[[1, 1], [2, 3], [1, 1]]],
87-
yield 'not unique objects' => [[$object, $object]],
82+
yield 'not unique booleans' => [[true, true], 'true'],
83+
yield 'not unique integers' => [[1, 2, 3, 3], 3],
84+
yield 'not unique floats' => [[0.1, 0.2, 0.1], 0.1],
85+
yield 'not unique string' => [['a', 'b', 'a'], '"a"'],
86+
yield 'not unique arrays' => [[[1, 1], [2, 3], [1, 1]], 'array'],
87+
yield 'not unique objects' => [[$object, $object], 'object'],
8888
];
8989
}
9090

@@ -94,7 +94,7 @@ public function testInvalidValueNamed()
9494
$this->validator->validate([1, 2, 3, 3], $constraint);
9595

9696
$this->buildViolation('myMessage')
97-
->setParameter('{{ value }}', 'array')
97+
->setParameter('{{ value }}', '3')
9898
->setCode(Unique::IS_NOT_UNIQUE)
9999
->assertRaised();
100100
}
@@ -174,7 +174,7 @@ public function testExpectsInvalidNonStrictComparison()
174174
]));
175175

176176
$this->buildViolation('myMessage')
177-
->setParameter('{{ value }}', 'array')
177+
->setParameter('{{ value }}', '1')
178178
->setCode(Unique::IS_NOT_UNIQUE)
179179
->assertRaised();
180180
}
@@ -200,7 +200,7 @@ public function testExpectsInvalidCaseInsensitiveComparison()
200200
]));
201201

202202
$this->buildViolation('myMessage')
203-
->setParameter('{{ value }}', 'array')
203+
->setParameter('{{ value }}', '"hello"')
204204
->setCode(Unique::IS_NOT_UNIQUE)
205205
->assertRaised();
206206
}

0 commit comments

Comments
 (0)