Skip to content

[Validator] Add hint for testing custom constraints #17124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2022
Merged

[Validator] Add hint for testing custom constraints #17124

merged 1 commit into from
Aug 9, 2022

Conversation

Rubinum
Copy link
Contributor

@Rubinum Rubinum commented Aug 6, 2022

I created some custom constraints lately and I stumbled upon the TestCase that symfony developers are using for testing out-of-the-box constraints like IsNull constraints. Since there is no hint in the docs about the ConstraintValidatorTestCase class, I thought it would be a great idea to add this to the docs. This class helped me alot when testing my constraints :)

@Rubinum Rubinum changed the title Add hint for testing custom constraints [Validator] Add hint for testing custom constraints Aug 6, 2022
@alexislefebvre
Copy link
Contributor

Does it work on version 4.4 or 5.4? Should the PR target a previous version?

@javiereguiluz javiereguiluz changed the base branch from 6.1 to 5.4 August 9, 2022 14:15
@javiereguiluz javiereguiluz requested a review from xabbuh as a code owner August 9, 2022 14:15
@javiereguiluz javiereguiluz merged commit 72236a2 into symfony:5.4 Aug 9, 2022
@javiereguiluz
Copy link
Member

Tim, thanks for this contribution. However, while merging it we had to make some changes. Basically we moved the contents to the article about "custom constraints". Therefore, we had to refactor the code to match the constraint shown in that other doc.

Here are the changes in case you want to double check them. Thanks!

3c97aee

@Rubinum
Copy link
Contributor Author

Rubinum commented Aug 9, 2022

@javiereguiluz Thank you.

Here are the changes in case you want to double check them. Thanks!

I am fine with the changes ❤️. Thank you for merging.

@wouterj wouterj mentioned this pull request Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants