Skip to content

Replace deprecated assertRegExp() with assertMatchesRegularExpression() #47

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
Nov 2, 2020

Conversation

andypost
Copy link
Contributor

@andypost andypost commented Nov 1, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? yes
Related tickets follow-up to #45
Documentation TBD
License MIT

What's in this PR?

In #45 compatibility with phpunit 9.3 was declared
But 9.3 throws warnings now on usage of assertRegExp() replaced with assertMatchesRegularExpression() in phpinit 9.1
Ref https://phpunit.readthedocs.io/en/9.1/assertions.html#assertmatchesregularexpression

Why?

Testing laminas/laminas-diactoros#46 travis reports this warnings because it using php 8 (nightly) so composer resolves phpunit to 9.3
Also package tests reports the same https://travis-ci.org/github/php-http/psr7-integration-tests/jobs/738863983#L393

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

To Do

  • If the PR is not complete but you want to discuss the approach, list what remains to be done here

@dbu
Copy link
Contributor

dbu commented Nov 2, 2020

thanks for looking into this. unfortunately, phpunit 9 does not run on PHP 7.2, so the builds for 7.2 now fail because the new method is not available. i think the solution is to add a method to the MessageTrait that does a method_exists check and falls back to the old assertion if it does not exist.

@andypost
Copy link
Contributor Author

andypost commented Nov 2, 2020

Good idea, thank you! Will update soon.

@andypost andypost force-pushed the master branch 2 times, most recently from 72d8345 to ec5d961 Compare November 2, 2020 10:26
@andypost
Copy link
Contributor Author

andypost commented Nov 2, 2020

Fixed both places and added to todo to remove later

@andypost
Copy link
Contributor Author

andypost commented Nov 2, 2020

@dbu thank you a lot! looks I need another coffee 🤦

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, now it looks fine 👍

@dbu dbu merged commit dbc81e5 into php-http:master Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants