clue · GitHub

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
....................................EEEEEEEEEEEEEEE............  63 / 280 ( 22%)
...EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE. 126 / 280 ( 45%)
........................................................EEEEEEE 189 / 280 ( 67%)
EE............................................................. 252 / 280 ( 90%)
............................                                    280 / 280 (100%)
Time: 00:01.309, Memory: 58.01 MB
There were 83 errors:
1) React\Tests\Dns\FunctionalResolverTest::testResolveLocalhostResolves
Creation of dynamic property React\Tests\Dns\FunctionalResolverTest::$loop is deprecated
/data/tests/FunctionalResolverTest.php:17
[…]
83) React\Tests\Dns\Query\SelectiveTransportExecutorTest::testRejectedPromiseAfterTruncatedResponseShouldNotCreateAnyGarbageReferences
Creation of dynamic property React\Tests\Dns\Query\SelectiveTransportExecutorTest::$datagram is deprecated
/data/tests/Query/SelectiveTransportExecutorTest.php:19
ERRORS!
Tests: 280, Assertions: 465, Errors: 83.

Refs reactphp/stream#165 and #186

Read the original on github.com ↗