Skip to content

Commit 3f53044

Browse files
minor symfony#32244 [Validator] pass error code as a string (xabbuh)
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] pass error code as a string | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 901fe0d pass error code as a string
2 parents 278bfba + 901fe0d commit 3f53044

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Validator/Tests/Validator/AbstractTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ public function testAddCustomizedViolation()
511511
->setParameter('%param%', 'value')
512512
->setInvalidValue('Invalid value')
513513
->setPlural(2)
514-
->setCode(42)
514+
->setCode('42')
515515
->addViolation();
516516
};
517517

@@ -528,7 +528,7 @@ public function testAddCustomizedViolation()
528528
$this->assertSame($entity, $violations[0]->getRoot());
529529
$this->assertSame('Invalid value', $violations[0]->getInvalidValue());
530530
$this->assertSame(2, $violations[0]->getPlural());
531-
$this->assertSame(42, $violations[0]->getCode());
531+
$this->assertSame('42', $violations[0]->getCode());
532532
}
533533

534534
public function testNoDuplicateValidationIfClassConstraintInMultipleGroups()

0 commit comments

Comments
 (0)