-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add ResponseIsUnprocessable assertion #40894
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
Labels
Comments
Thank you for this suggestion. |
I do. |
Please, go ahead and create a PR. |
fabpot
added a commit
that referenced
this issue
Oct 26, 2021
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- add ResponseIsUnprocessable | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #40894 | License | MIT | Doc PR | none Commits ------- 61df7f1 add ResponseIsUnprocessable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Now that we got an automatic way to get 422 response code when a form is invalid (see #40799), I think it could be nice to ease testing it.
I'm proposing to add a new method to
BrowserKitAssertionsTrait
:with relative constraint
Example
Instead of calling
self::assertResponseStatusCodeSame(422)
orself::assertResponseStatusCodeSame(Response::HTTP_UNPROCESSABLE_ENTITY)
each time that you want to test for a submitted invali form, you could simply callself::assertResponseIsUnprocessable()
The text was updated successfully, but these errors were encountered: