Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public function testAddCustomizedViolation()
->setParameter('%param%', 'value')
->setInvalidValue('Invalid value')
->setPlural(2)
->setCode(42)
->setCode('42')
->addViolation();
};

Expand All @@ -528,7 +528,7 @@ public function testAddCustomizedViolation()
$this->assertSame($entity, $violations[0]->getRoot());
$this->assertSame('Invalid value', $violations[0]->getInvalidValue());
$this->assertSame(2, $violations[0]->getPlural());
$this->assertSame(42, $violations[0]->getCode());
$this->assertSame('42', $violations[0]->getCode());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument is documented as string in ConstraintViolationBuilderInterface::setCode(). When adding type-hints in 5.0, we will need to compare the returned code with the string '42'. Making the change in the test here makes it consistent across all branches.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

public function testNoDuplicateValidationIfClassConstraintInMultipleGroups()
Expand Down