@@ -168,7 +168,7 @@ public function testConnectorRejectsWillRejectConnection()
168168 $ promise ->then (null , $ this ->expectCallableOnceWithException (
169169 'RuntimeException ' ,
170170 'Connection to tcp://google.com:80 failed because connection to proxy failed (ECONNREFUSED) ' ,
171- SOCKET_ECONNREFUSED
171+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
172172 ));
173173 }
174174
@@ -186,7 +186,7 @@ public function testCancelConnectionDuringConnectionWillCancelConnection()
186186 $ promise ->then (null , $ this ->expectCallableOnceWithException (
187187 'RuntimeException ' ,
188188 'Connection to tcp://google.com:80 cancelled while waiting for proxy (ECONNABORTED) ' ,
189- SOCKET_ECONNABORTED
189+ defined ( ' SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
190190 ));
191191 }
192192
@@ -205,7 +205,7 @@ public function testCancelConnectionDuringSessionWillCloseStream()
205205 $ promise ->then (null , $ this ->expectCallableOnceWithException (
206206 'RuntimeException ' ,
207207 'Connection to tcp://google.com:80 cancelled while waiting for proxy (ECONNABORTED) ' ,
208- SOCKET_ECONNABORTED
208+ defined ( ' SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
209209 ));
210210 }
211211
@@ -225,7 +225,7 @@ public function testCancelConnectionDuringDeferredSessionWillCloseStream()
225225 $ promise ->then (null , $ this ->expectCallableOnceWithException (
226226 'RuntimeException ' ,
227227 'Connection to tcp://google.com:80 cancelled while waiting for proxy (ECONNABORTED) ' ,
228- SOCKET_ECONNABORTED
228+ defined ( ' SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
229229 ));
230230 }
231231
@@ -244,7 +244,7 @@ public function testEmitConnectionCloseDuringSessionWillRejectConnection()
244244 $ promise ->then (null , $ this ->expectCallableOnceWithException (
245245 'RuntimeException ' ,
246246 'Connection to tcp://google.com:80 failed because connection to proxy was lost while waiting for response from proxy (ECONNRESET) ' ,
247- SOCKET_ECONNRESET
247+ defined ( ' SOCKET_ECONNRESET ' ) ? SOCKET_ECONNRESET : 104
248248 ));
249249 }
250250
@@ -263,7 +263,7 @@ public function testEmitConnectionErrorDuringSessionWillRejectConnection()
263263 $ promise ->then (null , $ this ->expectCallableOnceWithException (
264264 'RuntimeException ' ,
265265 'Connection to tcp://google.com:80 failed because connection to proxy caused a stream error (EIO) ' ,
266- SOCKET_EIO
266+ defined ( ' SOCKET_EIO ' ) ? SOCKET_EIO : 5
267267 ));
268268 }
269269
@@ -283,7 +283,7 @@ public function testEmitInvalidSocks4DataDuringSessionWillRejectConnection()
283283 $ promise ->then (null , $ this ->expectCallableOnceWithException (
284284 'RuntimeException ' ,
285285 'Connection to tcp://google.com:80 failed because proxy returned invalid response (EBADMSG) ' ,
286- SOCKET_EBADMSG
286+ defined ( ' SOCKET_EBADMSG ' ) ? SOCKET_EBADMSG : 71
287287 ));
288288 }
289289
@@ -305,7 +305,7 @@ public function testEmitInvalidSocks5DataDuringSessionWillRejectConnection()
305305 $ promise ->then (null , $ this ->expectCallableOnceWithException (
306306 'RuntimeException ' ,
307307 'Connection to tcp://google.com:80 failed because proxy returned invalid response (EBADMSG) ' ,
308- SOCKET_EBADMSG
308+ defined ( ' SOCKET_EBADMSG ' ) ? SOCKET_EBADMSG : 71
309309 ));
310310 }
311311
@@ -327,7 +327,7 @@ public function testEmitSocks5DataErrorDuringSessionWillRejectConnection()
327327 $ promise ->then (null , $ this ->expectCallableOnceWithException (
328328 'RuntimeException ' ,
329329 'Connection to tcp://google.com:80 failed because proxy refused connection with general server failure (ECONNREFUSED) ' ,
330- SOCKET_ECONNREFUSED
330+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
331331 ));
332332 }
333333
@@ -349,7 +349,7 @@ public function testEmitSocks5DataInvalidAuthenticationMethodWillRejectConnectio
349349 $ promise ->then (null , $ this ->expectCallableOnceWithException (
350350 'RuntimeException ' ,
351351 'Connection to tcp://google.com:80 failed because proxy denied access due to unsupported authentication method (EACCES) ' ,
352- SOCKET_EACCES
352+ defined ( ' SOCKET_EACCES ' ) ? SOCKET_EACCES : 13
353353 ));
354354 }
355355
@@ -371,7 +371,7 @@ public function testEmitSocks5DataInvalidAuthenticationDetailsWillRejectConnecti
371371 $ promise ->then (null , $ this ->expectCallableOnceWithException (
372372 'RuntimeException ' ,
373373 'Connection to tcp://google.com:80 failed because proxy denied access with given authentication details (EACCES) ' ,
374- SOCKET_EACCES
374+ defined ( ' SOCKET_EACCES ' ) ? SOCKET_EACCES : 13
375375 ));
376376 }
377377
@@ -393,7 +393,7 @@ public function testEmitSocks5DataInvalidAddressTypeWillRejectConnection()
393393 $ promise ->then (null , $ this ->expectCallableOnceWithException (
394394 'RuntimeException ' ,
395395 'Connection to tcp://google.com:80 failed because proxy returned invalid response (EBADMSG) ' ,
396- SOCKET_EBADMSG
396+ defined ( ' SOCKET_EBADMSG ' ) ? SOCKET_EBADMSG : 71
397397 ));
398398 }
399399
@@ -415,7 +415,7 @@ public function testEmitSocks4DataInvalidResponseWillRejectConnection()
415415 $ promise ->then (null , $ this ->expectCallableOnceWithException (
416416 'RuntimeException ' ,
417417 'Connection to tcp://google.com:80 failed because proxy refused connection with error code 0x55 (ECONNREFUSED) ' ,
418- SOCKET_ECONNREFUSED
418+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111
419419 ));
420420 }
421421
@@ -460,47 +460,47 @@ public function provideConnectionErrors()
460460 return array (
461461 array (
462462 Server::ERROR_GENERAL ,
463- SOCKET_ECONNREFUSED ,
463+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111 ,
464464 'failed because proxy refused connection with general server failure (ECONNREFUSED) '
465465 ),
466466 array (
467467 Server::ERROR_NOT_ALLOWED_BY_RULESET ,
468- SOCKET_EACCES ,
468+ defined ( ' SOCKET_EACCES ' ) ? SOCKET_EACCES : 13 ,
469469 'failed because proxy denied access due to ruleset (EACCES) '
470470 ),
471471 array (
472472 Server::ERROR_NETWORK_UNREACHABLE ,
473- SOCKET_ENETUNREACH ,
473+ defined ( ' SOCKET_ENETUNREACH ' ) ? SOCKET_ENETUNREACH : 101 ,
474474 'failed because proxy reported network unreachable (ENETUNREACH) '
475475 ),
476476 array (
477477 Server::ERROR_HOST_UNREACHABLE ,
478- SOCKET_EHOSTUNREACH ,
478+ defined ( ' SOCKET_EHOSTUNREACH ' ) ? SOCKET_EHOSTUNREACH : 113 ,
479479 'failed because proxy reported host unreachable (EHOSTUNREACH) '
480480 ),
481481 array (
482482 Server::ERROR_CONNECTION_REFUSED ,
483- SOCKET_ECONNREFUSED ,
483+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111 ,
484484 'failed because proxy reported connection refused (ECONNREFUSED) '
485485 ),
486486 array (
487487 Server::ERROR_TTL ,
488- SOCKET_ETIMEDOUT ,
488+ defined ( ' SOCKET_ETIMEDOUT ' ) ? SOCKET_ETIMEDOUT : 110 ,
489489 'failed because proxy reported TTL/timeout expired (ETIMEDOUT) '
490490 ),
491491 array (
492492 Server::ERROR_COMMAND_UNSUPPORTED ,
493- SOCKET_EPROTO ,
493+ defined ( ' SOCKET_EPROTO ' ) ? SOCKET_EPROTO : 71 ,
494494 'failed because proxy does not support the CONNECT command (EPROTO) '
495495 ),
496496 array (
497497 Server::ERROR_ADDRESS_UNSUPPORTED ,
498- SOCKET_EPROTO ,
498+ defined ( ' SOCKET_EPROTO ' ) ? SOCKET_EPROTO : 71 ,
499499 'failed because proxy does not support this address type (EPROTO) '
500500 ),
501501 array (
502502 200 ,
503- SOCKET_ECONNREFUSED ,
503+ defined ( ' SOCKET_ECONNREFUSED ' ) ? SOCKET_ECONNREFUSED : 111 ,
504504 'failed because proxy server refused connection with unknown error code 0xC8 (ECONNREFUSED) '
505505 )
506506 );
0 commit comments