Skip to content
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

expectExceptionMessageRegExp() has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 #4133

Closed
stof opened this issue Mar 6, 2020 · 3 comments
Assignees
Labels
feature/assertion Issues related to assertions and expectations type/bug Something is broken

Comments

@stof
Copy link
Contributor

stof commented Mar 6, 2020

Q A
PHPUnit version 9
PHP version 7.3
Installation Method Composer

Summary

The commit introducing expectExceptionMessageMatches says that expectExceptionMessageRegExp will trigger a warning in 9 and be removed in 10.
But the 9.0 removed the method entirely instead of adding a warning in it. This means that the method got removed without ever reporting a deprecation warning when running tests using it.
And there is no changelog saying that this method is deprecated (the PHPUnit 8 changelog does not talk about deprecating expectExceptionMessageRegExp and the PHPUnit 9 changelog says it is removed).

@stof stof added the type/bug Something is broken label Mar 6, 2020
@stof
Copy link
Contributor Author

stof commented Mar 6, 2020

expectExceptionMessageMatches has been added only in 8.4, which is why the PHPUnit 8 announcement does not talk about that at all.

@sebastianbergmann
Copy link
Owner

expectExceptionMessageRegExp() was deprecated in PHPUnit 8.4. The fact that this deprecation is not reported when the method is used in annoying, I agree, but is there really value in adding this behaviour in PHPUnit 8.5?

@stof
Copy link
Contributor Author

stof commented Mar 6, 2020

Well, the initial commit intended to add the deprecation warning in 9 (see the linked commit) and remove in 10. That's why there is no warning in 8.4 and 8.5.
The issue is that the removal was done without following the initial plan, and without adding the deprecation warning in 8.x, meaning that there is no warning at all.

The value of the warning is that I can work on the deprecation when seeing the warning (and all at once), rather than having to fix the fatal error due to the removed method, repeating this for each place using it until I don't get a fatal error anymore (or I could search expectExceptionMessageRegExp with my IDE indeed, but then it is not PHPUnit helping me to upgrade and that could justify not using deprecation warnings at all...).
If possible, I think it would make sense to add the warning in 8.5, yes.

@sebastianbergmann sebastianbergmann changed the title expectExceptionMessageRegExp has been removed in 9.0 without warning in previous versions expectExceptionMessageRegExp() has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 Mar 30, 2020
@sebastianbergmann sebastianbergmann self-assigned this Mar 30, 2020
@sebastianbergmann sebastianbergmann added the feature/assertion Issues related to assertions and expectations label Mar 30, 2020
gbirke added a commit to wmde/fundraising-application that referenced this issue Apr 6, 2020
PHPUnit 8.5.3 shows deprecation warnings when calling
expectExceptionMessageRegExp. PHPUnit was updated from 8.5.2 to 8.5.2 at
the beginning of this branch.

See sebastianbergmann/phpunit#4133
nicolas-grekas added a commit to symfony/symfony that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29 [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/messenger that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/form that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/mailer that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/config that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/process that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/routing that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/security that referenced this issue Apr 15, 2020
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
gbirke added a commit to wmde/fundraising-application that referenced this issue Apr 30, 2020
PHPUnit 8.5.3 shows deprecation warnings when calling
expectExceptionMessageRegExp. PHPUnit was updated from 8.5.2 to 8.5.2 at
the beginning of this branch.

See sebastianbergmann/phpunit#4133
Abban pushed a commit to wmde/fundraising-application that referenced this issue May 5, 2020
PHPUnit 8.5.3 shows deprecation warnings when calling
expectExceptionMessageRegExp. PHPUnit was updated from 8.5.2 to 8.5.2 at
the beginning of this branch.

See sebastianbergmann/phpunit#4133
symfony-splitter pushed a commit to symfony/messenger that referenced this issue Sep 28, 2021
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
symfony-splitter pushed a commit to symfony/mailer that referenced this issue Sep 28, 2021
…MessageMatches to provide FC with recent phpunit versions (soyuka)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | na
| License       | MIT
| Doc PR        | na

expectExceptionMessageRegExp is deprecated coming phpunit 8.5.3  see sebastianbergmann/phpunit#4133

Not sure if I need to add something else lmk.

Commits
-------

cfd5a29eaf [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/assertion Issues related to assertions and expectations type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants