Skip to content

Commit e58b280

Browse files
committed
Run tests on PHP 8.4 and update test environment
1 parent d9f16d2 commit e58b280

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ on:
77
jobs:
88
PHPUnit:
99
name: PHPUnit (PHP ${{ matrix.php }})
10-
runs-on: ubuntu-22.04
10+
runs-on: ubuntu-24.04
1111
strategy:
1212
matrix:
1313
php:
14+
- 8.4
1415
- 8.3
1516
- 8.2
1617
- 8.1
@@ -29,7 +30,7 @@ jobs:
2930
- uses: shivammathur/setup-php@v2
3031
with:
3132
php-version: ${{ matrix.php }}
32-
coverage: xdebug
33+
coverage: ${{ matrix.php < 8.0 && 'xdebug' || 'pcov' }}
3334
ini-file: development
3435
- run: composer install
3536
- run: docker pull busybox:latest

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react/promise-stream": "^1.6",
2020
"react/socket": "^1.16",
2121
"react/stream": "^1.4",
22-
"rize/uri-template": "^0.3"
22+
"rize/uri-template": "^0.3.8"
2323
},
2424
"require-dev": {
2525
"clue/caret-notation": "^0.2",

tests/FunctionalClientTest.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,17 +474,25 @@ public function testCreateConnectDisconnectAndRemoveNetwork()
474474
$promise = $this->client->containerRemove($container['Id']);
475475
$ret = \React\Async\await($promise);
476476

477-
// get all events between starting and removing for this container
477+
// get all events between starting and removing for this network
478478
$promise = $this->client->events($start, $end, array('network' => array($network['Id'])));
479479
$ret = \React\Async\await($promise);
480480

481-
// expects "create", "disconnect", "destroy" events ("connect" will be skipped because we don't start the container)
482-
$this->assertCount(3, $ret);
483-
$this->assertEquals('create', $ret[0]['Action']);
484-
$this->assertEquals('disconnect', $ret[1]['Action']);
485-
$this->assertEquals('destroy', $ret[2]['Action']);
481+
// Support for both Ubuntu 22.04 (3 events) and Ubuntu 24.04 (2 events)
482+
if (count($ret) === 3) {
483+
// On Ubuntu 22.04: expects "create", "disconnect", "destroy" events
484+
$this->assertEquals('create', $ret[0]['Action']);
485+
$this->assertEquals('disconnect', $ret[1]['Action']);
486+
$this->assertEquals('destroy', $ret[2]['Action']);
487+
} else {
488+
// On Ubuntu 24.04: expects only "create" and "destroy" events
489+
$this->assertCount(2, $ret);
490+
$this->assertEquals('create', $ret[0]['Action']);
491+
$this->assertEquals('destroy', $ret[1]['Action']);
492+
}
486493
}
487494

495+
488496
/**
489497
* @depends testImageInspectCheckIfBusyboxExists
490498
*/

0 commit comments

Comments
 (0)