@@ -241,7 +241,7 @@ protected function expectValidateAt(int $i, string $propertyPath, mixed $value,
241241 protected function expectValidateValue (int $ i , mixed $ value , array $ constraints = [], string |GroupSequence |array $ group = null )
242242 {
243243 $ contextualValidator = $ this ->context ->getValidator ()->inContext ($ this ->context );
244- $ contextualValidator ->expectValidation ($ i , '' , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
244+ $ contextualValidator ->expectValidation ($ i , null , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
245245 if (\is_array ($ constraints ) && !\is_array ($ passedConstraints )) {
246246 $ passedConstraints = [$ passedConstraints ];
247247 }
@@ -253,7 +253,7 @@ protected function expectValidateValue(int $i, mixed $value, array $constraints
253253 protected function expectFailingValueValidation (int $ i , mixed $ value , array $ constraints , string |GroupSequence |array |null $ group , ConstraintViolationInterface $ violation )
254254 {
255255 $ contextualValidator = $ this ->context ->getValidator ()->inContext ($ this ->context );
256- $ contextualValidator ->expectValidation ($ i , '' , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
256+ $ contextualValidator ->expectValidation ($ i , null , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
257257 if (\is_array ($ constraints ) && !\is_array ($ passedConstraints )) {
258258 $ passedConstraints = [$ passedConstraints ];
259259 }
@@ -575,9 +575,12 @@ public function expectNoValidate()
575575 $ this ->expectNoValidate = true ;
576576 }
577577
578- public function expectValidation (string $ call , string $ propertyPath , mixed $ value , string |GroupSequence |array |null $ group , callable $ constraints , ConstraintViolationInterface $ violation = null )
578+ public function expectValidation (string $ call , ? string $ propertyPath , mixed $ value , string |GroupSequence |array |null $ group , callable $ constraints , ConstraintViolationInterface $ violation = null )
579579 {
580- $ this ->expectedAtPath [$ call ] = $ propertyPath ;
580+ if (null !== $ propertyPath ) {
581+ $ this ->expectedAtPath [$ call ] = $ propertyPath ;
582+ }
583+
581584 $ this ->expectedValidate [$ call ] = [$ value , $ group , $ constraints , $ violation ];
582585 }
583586}
0 commit comments