@@ -294,7 +294,7 @@ public function testRejectsWithPreviousIfConnectorRejects()
294
294
$ promise ->then (null , $ this ->expectCallableOnceWithException (
295
295
'RuntimeException ' ,
296
296
'Connection to tcp://google.com:80 failed because connection to proxy failed (ECONNREFUSED) ' ,
297
- SOCKET_ECONNREFUSED
297
+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
298
298
));
299
299
300
300
$ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->callback (function (\Exception $ e ) use ($ previous ) {
@@ -319,7 +319,7 @@ public function testRejectsAndClosesIfStreamWritesNonHttp()
319
319
$ promise ->then (null , $ this ->expectCallableOnceWithException (
320
320
'RuntimeException ' ,
321
321
'Connection to tcp://google.com:80 failed because proxy returned invalid response (EBADMSG) ' ,
322
- SOCKET_EBADMSG
322
+ defined ( ' SOCKET_EBADMSG ' ) ? SOCKET_EBADMSG : 71
323
323
));
324
324
}
325
325
@@ -340,7 +340,7 @@ public function testRejectsAndClosesIfStreamWritesTooMuchData()
340
340
$ promise ->then (null , $ this ->expectCallableOnceWithException (
341
341
'RuntimeException ' ,
342
342
'Connection to tcp://google.com:80 failed because proxy response headers exceed maximum of 8 KiB (EMSGSIZE) ' ,
343
- SOCKET_EMSGSIZE
343
+ defined ( ' SOCKET_EMSGSIZE ' ) ? SOCKET_EMSGSIZE : 90
344
344
));
345
345
}
346
346
@@ -361,7 +361,7 @@ public function testRejectsAndClosesIfStreamReturnsProyAuthenticationRequired()
361
361
$ promise ->then (null , $ this ->expectCallableOnceWithException (
362
362
'RuntimeException ' ,
363
363
'Connection to tcp://google.com:80 failed because proxy denied access with HTTP error code 407 (Proxy Authentication Required) (EACCES) ' ,
364
- SOCKET_EACCES
364
+ defined ( ' SOCKET_EACCES ' ) ? SOCKET_EACCES : 13
365
365
));
366
366
}
367
367
@@ -382,7 +382,7 @@ public function testRejectsAndClosesIfStreamReturnsNonSuccess()
382
382
$ promise ->then (null , $ this ->expectCallableOnceWithException (
383
383
'RuntimeException ' ,
384
384
'Connection to tcp://google.com:80 failed because proxy refused connection with HTTP error code 403 (Not allowed) (ECONNREFUSED) ' ,
385
- SOCKET_ECONNREFUSED
385
+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
386
386
));
387
387
}
388
388
@@ -402,7 +402,7 @@ public function testRejectsWithPreviousExceptionIfStreamEmitsError()
402
402
$ promise ->then (null , $ this ->expectCallableOnceWithException (
403
403
'RuntimeException ' ,
404
404
'Connection to tcp://google.com:80 failed because connection to proxy caused a stream error (EIO) ' ,
405
- SOCKET_EIO
405
+ defined ( ' SOCKET_EIO ' ) ? SOCKET_EIO : 5
406
406
));
407
407
408
408
$ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->callback (function (\Exception $ e ) use ($ previous ) {
@@ -471,7 +471,7 @@ public function testCancelPromiseWhileConnectionIsReadyWillCloseOpenConnectionAn
471
471
$ promise ->then (null , $ this ->expectCallableOnceWithException (
472
472
'RuntimeException ' ,
473
473
'Connection to tcp://google.com:80 cancelled while waiting for proxy (ECONNABORTED) ' ,
474
- SOCKET_ECONNABORTED
474
+ defined ( ' SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
475
475
));
476
476
}
477
477
0 commit comments