Skip to content

[TwigComponent]: Fix silently failing tests #1810

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

Conversation

adrienlucas
Copy link

Q A
Bug fix? no
New feature? no
Issues Fix silently failing tests
License MIT

This tries to fix two little mistakes :

  • the expectException should never be used twice in a test (because it does not actually try/catch, the first exception will stop the execution of the test and will be catched outside).
  • the piece of code that is expected to throw an exception should always come last in the test (because again, no try/catch, so any line after the throwing line will not be executed).

@smnandre
Copy link
Member

Thank you @adrienlucas !

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Apr 30, 2024
@kbond
Copy link
Member

kbond commented Apr 30, 2024

Excellent catch Adrien, thank you!

@kbond kbond merged commit 749b13e into symfony:2.x Apr 30, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer TwigComponent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants