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 #201

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

....................................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

@clue clue added this to the v1.10.0 milestone Jun 17, 2022
@clue clue requested a review from WyriHaximus June 17, 2022 10:41
@WyriHaximus WyriHaximus merged commit c0902ed into reactphp:1.x Jun 24, 2022
@clue clue deleted the php8.2 branch June 25, 2022 16:47
@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