Skip to content

Commit

Permalink
Merge pull request #269 from clue-labs/php8.3
Browse files Browse the repository at this point in the history
Test on PHP 8.3 and update test environment
  • Loading branch information
WyriHaximus authored Oct 24, 2023
2 parents f665998 + f1f14b8 commit c0ae01e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
strategy:
matrix:
php:
- 8.3
- 8.2
- 8.1
- 8.0
Expand All @@ -24,7 +25,7 @@ jobs:
- 5.4
- 5.3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
- 5.4
- 5.3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
strategy:
matrix:
php:
- 8.3
- 8.2
- 8.1
- 8.0
Expand All @@ -114,7 +116,7 @@ jobs:
- 7.2
- 7.1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
Expand All @@ -132,7 +134,7 @@ jobs:
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
- name: Run hhvm composer.phar install
uses: docker://hhvm/hhvm:3.30-lts-latest
Expand Down
33 changes: 15 additions & 18 deletions tests/LoopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use React\EventLoop\Factory;
use React\EventLoop\Loop;
use ReflectionClass;

final class LoopTest extends TestCase
{
Expand Down Expand Up @@ -66,7 +65,7 @@ public function testStaticAddReadStreamWithNoDefaultLoopCallsAddReadStreamOnNewL
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = stream_socket_server('127.0.0.1:0');
$listener = function () { };
Expand All @@ -92,7 +91,7 @@ public function testStaticAddWriteStreamWithNoDefaultLoopCallsAddWriteStreamOnNe
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = stream_socket_server('127.0.0.1:0');
$listener = function () { };
Expand All @@ -117,7 +116,7 @@ public function testStaticRemoveReadStreamWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = tmpfile();
Loop::removeReadStream($stream);
Expand All @@ -141,7 +140,7 @@ public function testStaticRemoveWriteStreamWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$stream = tmpfile();
Loop::removeWriteStream($stream);
Expand Down Expand Up @@ -169,7 +168,7 @@ public function testStaticAddTimerWithNoDefaultLoopCallsAddTimerOnNewLoopInstanc
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$interval = 1.0;
$callback = function () { };
Expand Down Expand Up @@ -199,7 +198,7 @@ public function testStaticAddPeriodicTimerWithNoDefaultLoopCallsAddPeriodicTimer
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$interval = 1.0;
$callback = function () { };
Expand All @@ -226,7 +225,7 @@ public function testStaticCancelTimerWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$timer = $this->getMockBuilder('React\EventLoop\TimerInterface')->getMock();
Loop::cancelTimer($timer);
Expand All @@ -250,7 +249,7 @@ public function testStaticFutureTickWithNoDefaultLoopCallsFutureTickOnNewLoopIns
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$listener = function () { };
Loop::futureTick($listener);
Expand Down Expand Up @@ -279,7 +278,7 @@ public function testStaticAddSignalWithNoDefaultLoopCallsAddSignalOnNewLoopInsta

$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$signal = 1;
$listener = function () { };
Expand Down Expand Up @@ -309,7 +308,7 @@ public function testStaticRemoveSignalWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

$signal = 1;
$listener = function () { };
Expand All @@ -332,7 +331,7 @@ public function testStaticRunWithNoDefaultLoopCallsRunsOnNewLoopInstance()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

Loop::run();

Expand All @@ -353,7 +352,7 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
{
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null);
$ref->setValue(null, null);

Loop::stop();

Expand All @@ -366,10 +365,8 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
*/
public function unsetLoopFromLoopAccessor()
{
$ref = new ReflectionClass('\React\EventLoop\Loop');
$prop = $ref->getProperty('instance');
$prop->setAccessible(true);
$prop->setValue(null);
$prop->setAccessible(false);
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
$ref->setAccessible(true);
$ref->setValue(null, null);
}
}

0 comments on commit c0ae01e

Please sign in to comment.