Skip to content

Commit 6a26aff

Browse files
authored
Merge pull request #179 from clue-labs/php8.5
Run tests on PHP 8.5 and update test environment
2 parents b66ca6c + 3445dfe commit 6a26aff

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.5
1415
- 8.4
1516
- 8.3
1617
- 8.2
@@ -21,7 +22,7 @@ jobs:
2122
- 7.2
2223
- 7.1
2324
steps:
24-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
2526
- uses: shivammathur/setup-php@v2
2627
with:
2728
php-version: ${{ matrix.php }}
@@ -46,6 +47,7 @@ jobs:
4647
strategy:
4748
matrix:
4849
php:
50+
- 8.5
4951
- 8.4
5052
- 8.3
5153
- 8.2
@@ -56,7 +58,7 @@ jobs:
5658
- 7.2
5759
- 7.1
5860
steps:
59-
- uses: actions/checkout@v4
61+
- uses: actions/checkout@v6
6062
- uses: shivammathur/setup-php@v2
6163
with:
6264
php-version: ${{ matrix.php }}

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"php": ">=7.1",
1515
"clue/redis-protocol": "^0.3.2",
1616
"evenement/evenement": "^3.0 || ^2.0 || ^1.0",
17-
"react/event-loop": "^1.2",
18-
"react/promise": "^3.2",
19-
"react/socket": "^1.16"
17+
"react/event-loop": "^1.6",
18+
"react/promise": "^3.3",
19+
"react/socket": "^1.17"
2020
},
2121
"require-dev": {
22-
"phpstan/phpstan": "1.12.13 || 1.4.10",
22+
"phpstan/phpstan": "1.12.32 || 1.4.10",
2323
"phpunit/phpunit": "^9.6 || ^7.5",
2424
"react/async": "^4.3 || ^3.2"
2525
},

tests/RedisClientTest.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function setUp(): void
4040
$this->redis = new RedisClient('localhost');
4141

4242
$ref = new \ReflectionProperty($this->redis, 'factory');
43-
$ref->setAccessible(true);
43+
if (PHP_VERSION_ID < 80100) {
44+
$ref->setAccessible(true);
45+
}
4446
$ref->setValue($this->redis, $this->factory);
4547
}
4648

@@ -124,7 +126,9 @@ public function testPingWithAuthWillCreateUnderlyingClientWithAuthAndReturnPendi
124126
{
125127
$this->redis = new RedisClient('user:pass@localhost');
126128
$ref = new \ReflectionProperty($this->redis, 'factory');
127-
$ref->setAccessible(true);
129+
if (PHP_VERSION_ID < 80100) {
130+
$ref->setAccessible(true);
131+
}
128132
$ref->setValue($this->redis, $this->factory);
129133

130134
$promise = new Promise(function () { });
@@ -144,7 +148,9 @@ public function testPingWithUnixUriWillCreateUnderlyingClientAndReturnPendingPro
144148
{
145149
$this->redis = new RedisClient('redis+unix:///tmp/redis.sock');
146150
$ref = new \ReflectionProperty($this->redis, 'factory');
147-
$ref->setAccessible(true);
151+
if (PHP_VERSION_ID < 80100) {
152+
$ref->setAccessible(true);
153+
}
148154
$ref->setValue($this->redis, $this->factory);
149155

150156
$promise = new Promise(function () { });
@@ -193,7 +199,9 @@ public function testPingWillResolveWhenUnderlyingClientResolvesPingAndStartIdleT
193199
$this->redis = new RedisClient('localhost?idle=10');
194200

195201
$ref = new \ReflectionProperty($this->redis, 'factory');
196-
$ref->setAccessible(true);
202+
if (PHP_VERSION_ID < 80100) {
203+
$ref->setAccessible(true);
204+
}
197205
$ref->setValue($this->redis, $this->factory);
198206

199207
$client = $this->createMock(StreamingClient::class);
@@ -218,7 +226,9 @@ public function testPingWillResolveWhenUnderlyingClientResolvesPingAndNotStartId
218226
$this->redis = new RedisClient('localhost?idle=-1');
219227

220228
$ref = new \ReflectionProperty($this->redis, 'factory');
221-
$ref->setAccessible(true);
229+
if (PHP_VERSION_ID < 80100) {
230+
$ref->setAccessible(true);
231+
}
222232
$ref->setValue($this->redis, $this->factory);
223233

224234
$client = $this->createMock(StreamingClient::class);

0 commit comments

Comments
 (0)