-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow setting custom failure messages #17
Comments
I thought about this but decided against for the following reasons:
This all being said I don't have a strong opinion on this. |
I also rarely use this feature with PHPUnit, but in some cases it's very handy to help my future self. I understand why you've decided against, but is there another way to output a message, perhaps with a method that follows the assertion? Something like: ->assertSee('23rd January 2023')
->reportOnFailure('The date of the reservation is not correct') It's just an idea and it's not the end of the world if we can't do this - just have to add a comment in the test source code and then go look that up on failure so no drama really. |
I'm fine adding extra optional messages to the assertion methods.
Still not sure how we'd handle these.
The api is pretty stable so this isn't much of a concern anymore.
That would be tough because the assertion happens in the method above. Do you have an idea on how this could work?? |
Not at all it was just a throwaway suggestion :) |
PHPUnit's asserts (and all asserts provided by Symfony) allow you to specify a custom failure message as last argument. This gives you the possibility to add some more context to an otherwise vague error.
Would it be an idea to also add this feature to Browser?
The text was updated successfully, but these errors were encountered: