Skip to content

Conversation

@clue
Copy link
Member

@clue clue commented Jun 19, 2022

This changeset refactors the internal Transaction to avoid assigning dynamic properties for PHP 8.2+ compatibility. On top of this, it makes the test suite compatible as well. 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.21 #StandWithUkraine

.....................................................E.........  63 / 737 (  8%)
............................EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 126 / 737 ( 17%)
EEEEEEEEEEE..........................E......................... 189 / 737 ( 25%)
............................................................... 252 / 737 ( 34%)
............................................................... 315 / 737 ( 42%)
............................................................... 378 / 737 ( 51%)
............................................................... 441 / 737 ( 59%)
.................................................E............. 504 / 737 ( 68%)
............................................................... 567 / 737 ( 76%)
........................................EEEEEEEEEEEEEEEEEEEEEEE 630 / 737 ( 85%)
EEEEEEEEE...................................................... 693 / 737 ( 94%)
............................................                    737 / 737 (100%)

Time: 00:02.522, Memory: 20.00 MB

There were 81 errors:

1) React\Tests\Http\BrowserTest::testCancelGetRequestShouldCancelUnderlyingSocketConnection
Creation of dynamic property React\Promise\Deferred::$numRequests is deprecated

/data/src/Io/Transaction.php:77
/data/src/Browser.php:787
/data/src/Browser.php:113
/data/tests/BrowserTest.php:503


[…]

81) React\Tests\Http\Io\TransactionTest::testCancelTransactionShouldCancelSendingPromise
Creation of dynamic property React\Promise\Deferred::$numRequests is deprecated

/data/src/Io/Transaction.php:77
/data/tests/Io/TransactionTest.php:829

ERRORS!
Tests: 737, Assertions: 1617, Errors: 81.

Refs reactphp/dns#186, reactphp/dns#201 and reactphp/stream#165

@clue clue added this to the v1.7.0 milestone Jun 19, 2022
@clue clue requested a review from WyriHaximus June 19, 2022 12:55
@WyriHaximus WyriHaximus merged commit cf6b150 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 23, 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.

2 participants