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

Make tests compatible with PHP 8.2 by avoiding dynamic properties #165

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

clue
Copy link
Member

@clue clue commented Jun 17, 2022

This simple changeset makes the test suite compatible with PHP 8.2 by avoiding dynamic properties. Note that this involves only changes to the test suite, as the project itself is already fully forward compatible. PHP 8.2 is still under active development and has not reached feature freeze yet, so I've decided against adding it to the test matrix at this point in time. After applying this changeset, the tests work just fine. Prior to this, the test output can easily be checked like this:

$ docker run -it --rm -v `pwd`:/data --workdir=/data php:8.2-rc-cli vendor/bin/phpunit
PHPUnit 9.5.20 #StandWithUkraine

.............SSS.SSS.SSS.SSS.SSS.SSS.SSS.SSS.SSS.SSS.SSS.......  63 / 179 ( 35%)

Deprecated: Creation of dynamic property React\Tests\Stream\EnforceBlockingWrapper::$context is deprecated in /data/tests/DuplexResourceStreamTest.php on line 102
..
Deprecated: Creation of dynamic property React\Tests\Stream\EnforceBlockingWrapper::$context is deprecated in /data/tests/DuplexResourceStreamTest.php on line 132
................................
Deprecated: Creation of dynamic property React\Tests\Stream\EnforceBlockingWrapper::$context is deprecated in /data/tests/ReadableResourceStreamTest.php on line 101
............................. 126 / 179 ( 70%)
................................
Deprecated: Creation of dynamic property React\Tests\Stream\EnforceBlockingWrapper::$context is deprecated in /data/tests/WritableResourceStreamTest.php on line 99
.
Deprecated: Creation of dynamic property Mock_LoopInterface_d2f295a4::$preventWrites is deprecated in /data/tests/WritableResourceStreamTest.php on line 507
...
Deprecated: Creation of dynamic property Mock_LoopInterface_d2f295a4::$preventWrites is deprecated in /data/tests/WritableResourceStreamTest.php on line 507
..
Deprecated: Creation of dynamic property Mock_LoopInterface_d2f295a4::$preventWrites is deprecated in /data/tests/WritableResourceStreamTest.php on line 507
...............           179 / 179 (100%)

Time: 00:02.744, Memory: 8.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 179, Assertions: 260, Skipped: 33.

Refs reactphp/dns#186

@WyriHaximus WyriHaximus merged commit 68c2121 into reactphp:1.x Jun 24, 2022
@clue clue deleted the php8.2 branch June 25, 2022 16:46
@clue clue mentioned this pull request Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants