File tree Expand file tree Collapse file tree 5 files changed +20
-12
lines changed Expand file tree Collapse file tree 5 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 7
7
jobs :
8
8
PHPUnit :
9
9
name : PHPUnit (PHP ${{ matrix.php }})
10
- runs-on : ubuntu-22 .04
10
+ runs-on : ubuntu-24 .04
11
11
strategy :
12
12
matrix :
13
13
php :
29
29
- uses : shivammathur/setup-php@v2
30
30
with :
31
31
php-version : ${{ matrix.php }}
32
- coverage : xdebug
32
+ coverage : ${{ matrix.php < 8.0 && ' xdebug' || 'pcov' }}
33
33
ini-file : development
34
34
- run : composer install
35
35
- run : docker pull busybox:latest
Original file line number Diff line number Diff line change 14
14
"php" : " >=5.3" ,
15
15
"clue/json-stream" : " ^0.1" ,
16
16
"react/event-loop" : " ^1.2" ,
17
- "react/http" : " ^1.8 " ,
18
- "react/promise" : " ^3.1 || ^2.11 || ^1.3" ,
17
+ "react/http" : " ^1.11 " ,
18
+ "react/promise" : " ^3.2 || ^2.11 || ^1.3" ,
19
19
"react/promise-stream" : " ^1.6" ,
20
- "react/socket" : " ^1.12 " ,
21
- "react/stream" : " ^1.2 " ,
20
+ "react/socket" : " ^1.16 " ,
21
+ "react/stream" : " ^1.4 " ,
22
22
"rize/uri-template" : " ^0.3"
23
23
},
24
24
"require-dev" : {
25
25
"clue/caret-notation" : " ^0.2" ,
26
26
"clue/tar-react" : " ^0.2" ,
27
27
"phpunit/phpunit" : " ^9.6 || ^5.7 || ^4.8.36" ,
28
- "react/async" : " ^4 || ^3 || ^2"
28
+ "react/async" : " ^4.2 || ^3 || ^2"
29
29
},
30
30
"autoload" : {
31
31
"psr-4" : {
Original file line number Diff line number Diff line change @@ -56,8 +56,12 @@ class Client
56
56
* @param ?string $url
57
57
* @throws \InvalidArgumentException
58
58
*/
59
- public function __construct (LoopInterface $ loop = null , $ url = null )
59
+ public function __construct ($ loop = null , $ url = null )
60
60
{
61
+ if ($ loop !== null && !$ loop instanceof LoopInterface) { // manual type check to support legacy PHP < 7.1
62
+ throw new \InvalidArgumentException ('Argument #1 ($loop) expected null|React\EventLoop\LoopInterface ' );
63
+ }
64
+
61
65
if ($ url === null ) {
62
66
$ url = 'unix:///var/run/docker.sock ' ;
63
67
}
Original file line number Diff line number Diff line change @@ -59,6 +59,12 @@ public function testCtorWithLoop()
59
59
new Client ($ loop );
60
60
}
61
61
62
+ public function testCtorThrowsForInvalidLoop ()
63
+ {
64
+ $ this ->setExpectedException ('InvalidArgumentException ' , 'Argument #1 ($loop) expected null|React\EventLoop\LoopInterface ' );
65
+ new Client ('loop ' );
66
+ }
67
+
62
68
public function testCtorWithInvalidUrlThrows ()
63
69
{
64
70
$ this ->setExpectedException ('InvalidArgumentException ' );
Original file line number Diff line number Diff line change @@ -478,11 +478,9 @@ public function testCreateConnectDisconnectAndRemoveNetwork()
478
478
$ promise = $ this ->client ->events ($ start , $ end , array ('network ' => array ($ network ['Id ' ])));
479
479
$ ret = \React \Async \await ($ promise );
480
480
481
- // expects "create", "disconnect", "destroy" events ("connect" will be skipped because we don't start the container)
482
- $ this ->assertCount (3 , $ ret );
481
+ $ this ->assertCount (2 , $ ret );
483
482
$ this ->assertEquals ('create ' , $ ret [0 ]['Action ' ]);
484
- $ this ->assertEquals ('disconnect ' , $ ret [1 ]['Action ' ]);
485
- $ this ->assertEquals ('destroy ' , $ ret [2 ]['Action ' ]);
483
+ $ this ->assertEquals ('destroy ' , $ ret [1 ]['Action ' ]);
486
484
}
487
485
488
486
/**
You can’t perform that action at this time.
0 commit comments