@@ -238,7 +238,7 @@ protected function expectValidateAt(int $i, string $propertyPath, $value, $group
238
238
protected function expectValidateValue (int $ i , $ value , array $ constraints = [], $ group = null )
239
239
{
240
240
$ contextualValidator = $ this ->context ->getValidator ()->inContext ($ this ->context );
241
- $ contextualValidator ->expectValidation ($ i , '' , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
241
+ $ contextualValidator ->expectValidation ($ i , null , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
242
242
if (\is_array ($ constraints ) && !\is_array ($ passedConstraints )) {
243
243
$ passedConstraints = [$ passedConstraints ];
244
244
}
@@ -250,7 +250,7 @@ protected function expectValidateValue(int $i, $value, array $constraints = [],
250
250
protected function expectFailingValueValidation (int $ i , $ value , array $ constraints , $ group , ConstraintViolationInterface $ violation )
251
251
{
252
252
$ contextualValidator = $ this ->context ->getValidator ()->inContext ($ this ->context );
253
- $ contextualValidator ->expectValidation ($ i , '' , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
253
+ $ contextualValidator ->expectValidation ($ i , null , $ value , $ group , function ($ passedConstraints ) use ($ constraints ) {
254
254
if (\is_array ($ constraints ) && !\is_array ($ passedConstraints )) {
255
255
$ passedConstraints = [$ passedConstraints ];
256
256
}
@@ -573,9 +573,12 @@ public function expectNoValidate()
573
573
$ this ->expectNoValidate = true ;
574
574
}
575
575
576
- public function expectValidation (string $ call , string $ propertyPath , $ value , $ group , callable $ constraints , ConstraintViolationInterface $ violation = null )
576
+ public function expectValidation (string $ call , ? string $ propertyPath , $ value , $ 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