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

Add support for PHPUnit10 and remove support for PHPUnit8 #60

Closed
wants to merge 8 commits into from

Conversation

nyamsprod
Copy link
Contributor

@nyamsprod nyamsprod commented Feb 27, 2023

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Related tickets fixes #59
License MIT

What's in this PR?

  • Upgrade of the test suite to work with PHPUnit 10.
  • Removal of PHPUnit deprecated methods.
  • No changes is made to try to fix issues raised by the RingCentral, Slim and Nylhom implementations as they are out of scope for this PR.

To Do

  • CHANGELOG not updated yet

@nyamsprod
Copy link
Contributor Author

To avoid BC break:

  • abstract classes are not renamed
  • attributes are not used only annotations are used
  • PHPUnit configuration file is not migrated (it could be migrated to 9.5+ format if we increase the minimum version needed for PHPUnit 9 to run on)

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 a lot! i added some nitpicks.

@Nyholm @weierophinney do you have a way to check if there are any regressions with the php http clients using these integration tests? looking at the CI of this repository, i see that it only provides the tests but does not run them.

src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Show resolved Hide resolved
src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Outdated Show resolved Hide resolved
src/MessageTrait.php Show resolved Hide resolved
src/MessageTrait.php Show resolved Hide resolved
composer.json Show resolved Hide resolved
@dbu
Copy link
Contributor

dbu commented Apr 7, 2023

i fixed the ci to run the tests. and we meanwhile completely removed the references to obsolete zend diactoros in favor of laminas.

can you please rebase on the current master branch and solve the conflicts?

@dbu
Copy link
Contributor

dbu commented Apr 7, 2023

PHPUnit configuration file is not migrated (it could be migrated to 9.5+ format if we increase the minimum version needed for PHPUnit 9 to run on)

i would be in favor of raising phpunit 9 to 9.5 to allow upgrading the configuration file to the new format.

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 a lot! i think we are almost there.

some test runs fail because implementations are not perfect, we will merge despite that. but looking into the output i found some problems that we should fix.

composer.json Show resolved Hide resolved
composer.json Show resolved Hide resolved
@dbu
Copy link
Contributor

dbu commented Apr 28, 2023

ping @nyamsprod do you want to try upgrading the configuration file? and please rebase on the master branch to solve the conflicts

@nyamsprod
Copy link
Contributor Author

@dbu sorry for the late reply I was overloaded by work all week .. will do the proper fix this weekend

@dbu
Copy link
Contributor

dbu commented Apr 28, 2023

great, thanks!

no worries, in OSS we do what we can, the job and health and family all take priority before OSS

@nyamsprod
Copy link
Contributor Author

@dbu did update the PR in regard to your latest comments. Hopes everything is fine now

@@ -13,3 +13,4 @@
/phpunit.xml.dist export-ignore
/spec/ export-ignore
/tests/ export-ignore
/.phpunit.cache/ export-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/.phpunit.cache/ export-ignore

this is not committed and should not. .gitattributes tells github what to exclude when downloading the zip of a repository. we instead want tot add this in .gitignore

"psr/http-message": "^1.0 || ^2.0"
"php": "^7.3 || ^8.0",
"phpunit/phpunit": "^9.3 || ^10.0",
"psr/http-message": "^1.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"psr/http-message": "^1.0"
"psr/http-message": "^1.0 || ^2.0"

we should keep allowing http-message 2.0. i think this was one of the merge conflicts.

src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Outdated Show resolved Hide resolved
src/BaseTest.php Outdated
return $factory->createUri($uri);
}
if ($factory instanceof \Psr\Http\Message\UriFactoryInterface) {
if ($uri instanceof UriInterface) {
if ($factory instanceof PsrUriFactoryInterface) {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing use with alias?

src/BaseTest.php Outdated Show resolved Hide resolved
@dbu
Copy link
Contributor

dbu commented May 23, 2023

did update the PR in regard to your latest comments. Hopes everything is fine now

thanks for your work.

i think that some test suites do not fail means the instanceof checks are not tested in the CI tests. i don't see how they could work without the alias. but i prefer that we keep the fully qualified class names in the BaseTest to make it more explicit to read. can you please switch them back to the FQN?

@dbu
Copy link
Contributor

dbu commented May 23, 2023

note that some implementations will have some tests failing - I will compare those with the 1.x branch to see if there are any differences.

@nyamsprod
Copy link
Contributor Author

@dbu any update on this PR ? Do I still need to do something ?

@dbu dbu mentioned this pull request Mar 25, 2024
@dbu
Copy link
Contributor

dbu commented Mar 25, 2024

oh, i forgot about this. thanks for the reminder.

i am solving the merge conflicts and do some tweaks in #75 . thank you for the contribution!

i close this merge request, but the commit in #75 is still attributed to you.

@dbu dbu closed this Mar 25, 2024
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.

Make this integration test work with PHPUnit 10
4 participants