@@ -239,7 +239,7 @@ protected function expectValidateAt(int $i, string $propertyPath, mixed $value,
239
239
protected function expectValidateValue (int $ i , mixed $ value , array $ constraints = [], string |GroupSequence |array $ group = null )
240
240
{
241
241
$ contextualValidator = $ this ->context ->getValidator ()->inContext ($ this ->context );
242
- $ contextualValidator ->expectValidation ($ i , '' , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
242
+ $ contextualValidator ->expectValidation ($ i , null , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
243
243
if (\is_array ($ constraints ) && !\is_array ($ passedConstraints )) {
244
244
$ passedConstraints = [$ passedConstraints ];
245
245
}
@@ -251,7 +251,7 @@ protected function expectValidateValue(int $i, mixed $value, array $constraints
251
251
protected function expectFailingValueValidation (int $ i , mixed $ value , array $ constraints , string |GroupSequence |array |null $ group , ConstraintViolationInterface $ violation )
252
252
{
253
253
$ contextualValidator = $ this ->context ->getValidator ()->inContext ($ this ->context );
254
- $ contextualValidator ->expectValidation ($ i , '' , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
254
+ $ contextualValidator ->expectValidation ($ i , null , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
255
255
if (\is_array ($ constraints ) && !\is_array ($ passedConstraints )) {
256
256
$ passedConstraints = [$ passedConstraints ];
257
257
}
@@ -573,9 +573,12 @@ public function expectNoValidate()
573
573
$ this ->expectNoValidate = true ;
574
574
}
575
575
576
- public function expectValidation (string $ call , string $ propertyPath , mixed $ value , string |GroupSequence |array |null $ group , callable $ constraints , ConstraintViolationInterface $ violation = null )
576
+ public function expectValidation (string $ call , ? string $ propertyPath , mixed $ value , string |GroupSequence |array |null $ group , callable $ constraints , ConstraintViolationInterface $ violation = null )
577
577
{
578
- $ this ->expectedAtPath [$ call ] = $ propertyPath ;
578
+ if (null !== $ propertyPath ) {
579
+ $ this ->expectedAtPath [$ call ] = $ propertyPath ;
580
+ }
581
+
579
582
$ this ->expectedValidate [$ call ] = [$ value , $ group , $ constraints , $ violation ];
580
583
}
581
584
}
0 commit comments