Skip to content

Commit 47e0e8e

Browse files
authored
Merge pull request #77 from clue-labs/php8.5
Run tests on PHP 8.5 and update test environment
2 parents 00df378 + 24341b3 commit 47e0e8e

3 files changed

Lines changed: 30 additions & 11 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os:
14-
- ubuntu-22.04
14+
- ubuntu-24.04
1515
env:
1616
- client
1717
- server
@@ -22,8 +22,9 @@ jobs:
2222
- 8.2
2323
- 8.3
2424
- 8.4
25+
- 8.5
2526
steps:
26-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
2728
- name: Setup PHP
2829
uses: shivammathur/setup-php@v2
2930
with:

‎tests/unit/Messaging/FrameTest.php‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,18 @@ public function testFirstPayloadDesignationValue(int $bits, string $bin): void {
162162
$this->_frame->addBuffer(static::encode($bin));
163163
$ref = new \ReflectionClass($this->_frame);
164164
$cb = $ref->getMethod('getFirstPayloadVal');
165-
$cb->setAccessible(true);
165+
if (PHP_VERSION_ID < 80100) {
166+
$cb->setAccessible(true);
167+
}
166168
$this->assertEquals(bindec($bin), $cb->invoke($this->_frame));
167169
}
168170

169171
public function testFirstPayloadValUnderflow(): void {
170172
$ref = new \ReflectionClass($this->_frame);
171173
$cb = $ref->getMethod('getFirstPayloadVal');
172-
$cb->setAccessible(true);
174+
if (PHP_VERSION_ID < 80100) {
175+
$cb->setAccessible(true);
176+
}
173177
$this->expectException(\UnderflowException::class);
174178
$cb->invoke($this->_frame);
175179
}
@@ -182,14 +186,18 @@ public function testDetermineHowManyBitsAreUsedToDescribePayload(int $expected_b
182186
$this->_frame->addBuffer(static::encode($bin));
183187
$ref = new \ReflectionClass($this->_frame);
184188
$cb = $ref->getMethod('getNumPayloadBits');
185-
$cb->setAccessible(true);
189+
if (PHP_VERSION_ID < 80100) {
190+
$cb->setAccessible(true);
191+
}
186192
$this->assertEquals($expected_bits, $cb->invoke($this->_frame));
187193
}
188194

189195
public function testgetNumPayloadBitsUnderflow(): void {
190196
$ref = new \ReflectionClass($this->_frame);
191197
$cb = $ref->getMethod('getNumPayloadBits');
192-
$cb->setAccessible(true);
198+
if (PHP_VERSION_ID < 80100) {
199+
$cb->setAccessible(true);
200+
}
193201
$this->expectException(\UnderflowException::class);
194202
$cb->invoke($this->_frame);
195203
}

‎tests/unit/Messaging/MessageBufferTest.php‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ function (Frame $frame) use (&$controlFrame): void {
263263
*/
264264
public function testMemoryLimits(string $phpConfigurationValue, int $expectedLimit): void {
265265
$method = new \ReflectionMethod(MessageBuffer::class, 'getMemoryLimit');
266-
$method->setAccessible(true);
266+
if (PHP_VERSION_ID < 80100) {
267+
$method->setAccessible(true);
268+
}
267269
$actualLimit = $method->invoke(null, $phpConfigurationValue);
268270

269271
$this->assertSame($expectedLimit, $actualLimit);
@@ -339,11 +341,15 @@ static function (Frame $frame): void {},
339341
}
340342

341343
$prop = new \ReflectionProperty($messageBuffer, 'maxMessagePayloadSize');
342-
$prop->setAccessible(true);
344+
if (PHP_VERSION_ID < 80100) {
345+
$prop->setAccessible(true);
346+
}
343347
$this->assertEquals($expectedLimit / 4, $prop->getValue($messageBuffer));
344348

345349
$prop = new \ReflectionProperty($messageBuffer, 'maxFramePayloadSize');
346-
$prop->setAccessible(true);
350+
if (PHP_VERSION_ID < 80100) {
351+
$prop->setAccessible(true);
352+
}
347353
$this->assertEquals($expectedLimit / 4, $prop->getValue($messageBuffer));
348354
}
349355

@@ -365,11 +371,15 @@ function (Frame $frame) {},
365371
);
366372

367373
$prop = new \ReflectionProperty($messageBuffer, 'maxMessagePayloadSize');
368-
$prop->setAccessible(true);
374+
if (PHP_VERSION_ID < 80100) {
375+
$prop->setAccessible(true);
376+
}
369377
$this->assertEquals(0, $prop->getValue($messageBuffer));
370378

371379
$prop = new \ReflectionProperty($messageBuffer, 'maxFramePayloadSize');
372-
$prop->setAccessible(true);
380+
if (PHP_VERSION_ID < 80100) {
381+
$prop->setAccessible(true);
382+
}
373383
$this->assertEquals(0, $prop->getValue($messageBuffer));
374384
}
375385
}

0 commit comments

Comments
 (0)