-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support PHPUnit 10 #47
Conversation
Would love to see this reviewed and maybe merged/released 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's narrow this, and please squash your commits into one.
@@ -18,7 +18,7 @@ | |||
"require": { | |||
"php": "^7.1 || ^8.0", | |||
"psr/http-factory": "^1.0", | |||
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" | |||
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can change this to ^9.6 || ^10.0
since 9.6.x is the last series that supports PHP 7.3 (and up).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do that without dropping PHP 7.1 and 7.2 support. Guzzle still needs PHP 7.2 support, and other packages in the php-http namespace need 7.1 and 7.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. That's disappointing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The branch I linked in the OP is a cleanup that supports PHP 7.4+ - you can take it and do whatever you want with it. Alternatively, you can have the PHP 8.1+ version that I've included in my library's tests for the time being because this package breaks CI in its current form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do that without dropping PHP 7.1 and 7.2 support.
Can't those using older PHP versions continue using older release of this package?
a48bcc6
to
004f700
Compare
Choose your fighter:
|
Ping |
@@ -38,7 +38,7 @@ protected function assertRequest($request, $method, $uri) | |||
$this->assertSame($uri, (string) $request->getUri()); | |||
} | |||
|
|||
public function dataMethods() | |||
public static function dataMethods() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these made static? Is that a PHPUnit 10.x thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a PHPUnit 10.x thing?
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dataproviders need to be static in PHPUnit 10
{ | ||
$data = []; | ||
|
||
foreach ($this->dataMethods() as $methodData) { | ||
foreach (self::dataMethods() as $methodData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be static::
to mimic the old behaviour of being able to override dataMethods in the parent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
I'm not sure what to do here. PHP < 8.0 is officially EOL, so I don't know why we should be supported those versions, especially PHP < 7.4. Seems like we should probably tag the current HEAD and then create a new major version for PHPUnit 10 and supported PHP versions. |
004f700
to
88f766a
Compare
Yes please! |
Version 2.0.0 has been released with this change, with the modification of also requiring only PHPUnit 10.x and PHP 8.x. |
In that case you should update/use the cleaned up PHP 8.1+ branch i made which uses attributes to call the data providers instead of doc blocks (which is deprecated iirc). codemasher@a05443b |
New PRs welcomed |
This PR adds support for PHPUnit 10. From now on, data providers have to be static methods, which may or may not affect older PHPUnit versions.
Edit: there, saved you some work: codemasher@9b5da09