-
Notifications
You must be signed in to change notification settings - Fork 1.2k
PHP 8.0, 8.1, PHPUnit 9 support #2332
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
Conversation
| colors="true"> | ||
|
|
||
| <php> | ||
| <!-- Specify the path to your CloudFront private key --> |
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 was removed in favour of a change to the suite that enables this to run without any configuration
| public static function fromEpoch($unixTimestamp) | ||
| { | ||
| return new self(gmdate('c', $unixTimestamp)); | ||
| if (!is_numeric($unixTimestamp)) { |
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.
Same change as in #2331
| @@ -1,65 +1,64 @@ | |||
| <?php | |||
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.
Changes here use a private key fixture
|
|
||
| $handler = $list->resolve(); | ||
| $handler($command, new Request('POST', $endpoint)); | ||
| $handler($command, new Request('POST', $endpoint))->wait(false); |
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 fixes an issue that only showed itself in Guzzle or PHP 8.x
| { | ||
| } | ||
|
|
||
| public function setUp(): void |
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.
PHPUnit 9 added the void return type here, needing the polyfilled behaviour to compile on earlier PHP versions
| $loader = require __DIR__.'/../vendor/autoload.php'; | ||
|
|
||
| if (!class_exists('\PHPUnit\Framework\Constraint\RegularExpression')) { | ||
| if ( ! defined('PHPUNIT_COMPOSER_INSTALL')) { |
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.
To support the @runInSeparateProcess annotation
|
Hi @27pchrisl, Going to close this in favor of #2403. We want to get it merged relatively soon. |
Description of changes:
This PR adds support for running tests against PHP 8.0 and 8.1, and upgrades to PHPUnit 9 (for supported PHP versions).
The changes implement polyfills for older PHPUnit versions to add missing 9.x methods, and restores older methods that newer PHPUnit versions removed. This is implemented through the
PHPUnitCompatTrait, dynamically selected inbootstrap.php.As PHPUnit 9 added the
voidreturn type tosetUp,tearDown,setUpBeforeClassandtearDownAfterClass, the polyfills provide_-prefixed versions of these methods to support all PHP versions (eg_setUp).The only actual failing
srccode in 8.0/8.1 was the same as fixed in #2331. All other changes are only to the test suite. I'm commenting below on notable changes.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.