8000 Fixed mistake in exception expectation by uuf6429 · Pull Request #24557 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fixed mistake in exception expectation #24557

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
Oct 14, 2017
Merged

Fixed mistake in exception expectation #24557

merged 1 commit into from
Oct 14, 2017

Conversation

uuf6429
Copy link
Contributor
@uuf6429 uuf6429 commented Oct 14, 2017
Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

In some cases, (5 to be exact), the expectException is misused while attempting to provide compatibility with the older setExpectedException by making use of a non-existent parameter.
Firstly, this makes the tests inconsistent (old PHPUnit version test exception message, while newer one doesn't). Secondly, if PHPUnit interface suddenly starts making use of a 2nd parameter in expectException, the existing code might break or cause unexpected side-effects.

Original report: symfony/process@87bb726#commitcomment-24848315

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Oct 14, 2017
@nicolas-grekas
Copy link
Member

Thank you @uuf6429.

@nicolas-grekas nicolas-grekas merged commit 03be003 into symfony:3.3 Oct 14, 2017
nicolas-grekas added a commit that referenced this pull request Oct 14, 2017
This PR was merged into the 3.3 branch.

Discussion
----------

Fixed mistake in exception expectation

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

In some cases, (5 to be exact), the `expectException` is misused while attempting to provide compatibility with the older `setExpectedException` by making use of a non-existent parameter.
Firstly, this makes the tests inconsistent (old PHPUnit version test exception message, while newer one doesn't). Secondly, if PHPUnit interface suddenly starts making use of a 2nd parameter in `expectException`, the existing code might break or cause unexpected side-effects.

Original report: symfony/process@87bb726#commitcomment-24848315

Commits
-------

03be003 Fixed mistake in exception expectation
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
0