Skip to content

Commit c0ae01e

Browse files
authored
Merge pull request #269 from clue-labs/php8.3
Test on PHP 8.3 and update test environment
2 parents f665998 + f1f14b8 commit c0ae01e

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

.github/workflows/ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.3
1415
- 8.2
1516
- 8.1
1617
- 8.0
@@ -24,7 +25,7 @@ jobs:
2425
- 5.4
2526
- 5.3
2627
steps:
27-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2829
- uses: shivammathur/setup-php@v2
2930
with:
3031
php-version: ${{ matrix.php }}
@@ -57,7 +58,7 @@ jobs:
5758
- 5.4
5859
- 5.3
5960
steps:
60-
- uses: actions/checkout@v3
61+
- uses: actions/checkout@v4
6162
- uses: shivammathur/setup-php@v2
6263
with:
6364
php-version: ${{ matrix.php }}
@@ -106,6 +107,7 @@ jobs:
106107
strategy:
107108
matrix:
108109
php:
110+
- 8.3
109111
- 8.2
110112
- 8.1
111113
- 8.0
@@ -114,7 +116,7 @@ jobs:
114116
- 7.2
115117
- 7.1
116118
steps:
117-
- uses: actions/checkout@v3
119+
- uses: actions/checkout@v4
118120
- uses: shivammathur/setup-php@v2
119121
with:
120122
php-version: ${{ matrix.php }}
@@ -132,7 +134,7 @@ jobs:
132134
runs-on: ubuntu-22.04
133135
continue-on-error: true
134136
steps:
135-
- uses: actions/checkout@v3
137+
- uses: actions/checkout@v4
136138
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
137139
- name: Run hhvm composer.phar install
138140
uses: docker://hhvm/hhvm:3.30-lts-latest

tests/LoopTest.php

+15-18
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use React\EventLoop\Factory;
66
use React\EventLoop\Loop;
7-
use ReflectionClass;
87

98
final class LoopTest extends TestCase
109
{
@@ -66,7 +65,7 @@ public function testStaticAddReadStreamWithNoDefaultLoopCallsAddReadStreamOnNewL
6665
{
6766
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
6867
$ref->setAccessible(true);
69-
$ref->setValue(null);
68+
$ref->setValue(null, null);
7069

7170
$stream = stream_socket_server('127.0.0.1:0');
7271
$listener = function () { };
@@ -92,7 +91,7 @@ public function testStaticAddWriteStreamWithNoDefaultLoopCallsAddWriteStreamOnNe
9291
{
9392
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
9493
$ref->setAccessible(true);
95-
$ref->setValue(null);
94+
$ref->setValue(null, null);
9695

9796
$stream = stream_socket_server('127.0.0.1:0');
9897
$listener = function () { };
@@ -117,7 +116,7 @@ public function testStaticRemoveReadStreamWithNoDefaultLoopIsNoOp()
117116
{
118117
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
119118
$ref->setAccessible(true);
120-
$ref->setValue(null);
119+
$ref->setValue(null, null);
121120

122121
$stream = tmpfile();
123122
Loop::removeReadStream($stream);
@@ -141,7 +140,7 @@ public function testStaticRemoveWriteStreamWithNoDefaultLoopIsNoOp()
141140
{
142141
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
143142
$ref->setAccessible(true);
144-
$ref->setValue(null);
143+
$ref->setValue(null, null);
145144

146145
$stream = tmpfile();
147146
Loop::removeWriteStream($stream);
@@ -169,7 +168,7 @@ public function testStaticAddTimerWithNoDefaultLoopCallsAddTimerOnNewLoopInstanc
169168
{
170169
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
171170
$ref->setAccessible(true);
172-
$ref->setValue(null);
171+
$ref->setValue(null, null);
173172

174173
$interval = 1.0;
175174
$callback = function () { };
@@ -199,7 +198,7 @@ public function testStaticAddPeriodicTimerWithNoDefaultLoopCallsAddPeriodicTimer
199198
{
200199
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
201200
$ref->setAccessible(true);
202-
$ref->setValue(null);
201+
$ref->setValue(null, null);
203202

204203
$interval = 1.0;
205204
$callback = function () { };
@@ -226,7 +225,7 @@ public function testStaticCancelTimerWithNoDefaultLoopIsNoOp()
226225
{
227226
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
228227
$ref->setAccessible(true);
229-
$ref->setValue(null);
228+
$ref->setValue(null, null);
230229

231230
$timer = $this->getMockBuilder('React\EventLoop\TimerInterface')->getMock();
232231
Loop::cancelTimer($timer);
@@ -250,7 +249,7 @@ public function testStaticFutureTickWithNoDefaultLoopCallsFutureTickOnNewLoopIns
250249
{
251250
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
252251
$ref->setAccessible(true);
253-
$ref->setValue(null);
252+
$ref->setValue(null, null);
254253

255254
$listener = function () { };
256255
Loop::futureTick($listener);
@@ -279,7 +278,7 @@ public function testStaticAddSignalWithNoDefaultLoopCallsAddSignalOnNewLoopInsta
279278

280279
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
281280
$ref->setAccessible(true);
282-
$ref->setValue(null);
281+
$ref->setValue(null, null);
283282

284283
$signal = 1;
285284
$listener = function () { };
@@ -309,7 +308,7 @@ public function testStaticRemoveSignalWithNoDefaultLoopIsNoOp()
309308
{
310309
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
311310
$ref->setAccessible(true);
312-
$ref->setValue(null);
311+
$ref->setValue(null, null);
313312

314313
$signal = 1;
315314
$listener = function () { };
@@ -332,7 +331,7 @@ public function testStaticRunWithNoDefaultLoopCallsRunsOnNewLoopInstance()
332331
{
333332
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
334333
$ref->setAccessible(true);
335-
$ref->setValue(null);
334+
$ref->setValue(null, null);
336335

337336
Loop::run();
338337

@@ -353,7 +352,7 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
353352
{
354353
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
355354
$ref->setAccessible(true);
356-
$ref->setValue(null);
355+
$ref->setValue(null, null);
357356

358357
Loop::stop();
359358

@@ -366,10 +365,8 @@ public function testStaticStopCallWithNoDefaultLoopIsNoOp()
366365
*/
367366
public function unsetLoopFromLoopAccessor()
368367
{
369-
$ref = new ReflectionClass('\React\EventLoop\Loop');
370-
$prop = $ref->getProperty('instance');
371-
$prop->setAccessible(true);
372-
$prop->setValue(null);
373-
$prop->setAccessible(false);
368+
$ref = new \ReflectionProperty('React\EventLoop\Loop', 'instance');
369+
$ref->setAccessible(true);
370+
$ref->setValue(null, null);
374371
}
375372
}

0 commit comments

Comments
 (0)