@@ -294,7 +294,7 @@ public function testRejectsWithPreviousIfConnectorRejects()
294294 $ promise ->then (null , $ this ->expectCallableOnceWithException (
295295 'RuntimeException ' ,
296296 'Connection to tcp://google.com:80 failed because connection to proxy failed (ECONNREFUSED) ' ,
297- SOCKET_ECONNREFUSED
297+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
298298 ));
299299
300300 $ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->callback (function (\Exception $ e ) use ($ previous ) {
@@ -319,7 +319,7 @@ public function testRejectsAndClosesIfStreamWritesNonHttp()
319319 $ promise ->then (null , $ this ->expectCallableOnceWithException (
320320 'RuntimeException ' ,
321321 'Connection to tcp://google.com:80 failed because proxy returned invalid response (EBADMSG) ' ,
322- SOCKET_EBADMSG
322+ defined ( ' SOCKET_EBADMSG ' ) ? SOCKET_EBADMSG : 71
323323 ));
324324 }
325325
@@ -340,7 +340,7 @@ public function testRejectsAndClosesIfStreamWritesTooMuchData()
340340 $ promise ->then (null , $ this ->expectCallableOnceWithException (
341341 'RuntimeException ' ,
342342 '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
344344 ));
345345 }
346346
@@ -361,7 +361,7 @@ public function testRejectsAndClosesIfStreamReturnsProyAuthenticationRequired()
361361 $ promise ->then (null , $ this ->expectCallableOnceWithException (
362362 'RuntimeException ' ,
363363 '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
365365 ));
366366 }
367367
@@ -382,7 +382,7 @@ public function testRejectsAndClosesIfStreamReturnsNonSuccess()
382382 $ promise ->then (null , $ this ->expectCallableOnceWithException (
383383 'RuntimeException ' ,
384384 '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
386386 ));
387387 }
388388
@@ -402,7 +402,7 @@ public function testRejectsWithPreviousExceptionIfStreamEmitsError()
402402 $ promise ->then (null , $ this ->expectCallableOnceWithException (
403403 'RuntimeException ' ,
404404 '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
406406 ));
407407
408408 $ promise ->then (null , $ this ->expectCallableOnceWith ($ this ->callback (function (\Exception $ e ) use ($ previous ) {
@@ -471,7 +471,7 @@ public function testCancelPromiseWhileConnectionIsReadyWillCloseOpenConnectionAn
471471 $ promise ->then (null , $ this ->expectCallableOnceWithException (
472472 'RuntimeException ' ,
473473 'Connection to tcp://google.com:80 cancelled while waiting for proxy (ECONNABORTED) ' ,
474- SOCKET_ECONNABORTED
474+ defined ( ' SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
475475 ));
476476 }
477477
0 commit comments