@@ -167,7 +167,11 @@ public function testCancelDuringDnsCancelsDnsAndDoesNotStartTcpConnection()
167167 $ promise = $ this ->connector ->connect ('example.com:80 ' );
168168 $ promise ->cancel ();
169169
170- $ this ->setExpectedException ('RuntimeException ' , 'Connection to tcp://example.com:80 cancelled during DNS lookup ' );
170+ $ this ->setExpectedException (
171+ 'RuntimeException ' ,
172+ 'Connection to tcp://example.com:80 cancelled during DNS lookup ' ,
173+ defined ('SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
174+ );
171175 $ this ->throwRejection ($ promise );
172176 }
173177
@@ -196,7 +200,10 @@ public function testCancelDuringTcpConnectionCancelsTcpConnectionWithTcpRejectio
196200 $ first = new Deferred ();
197201 $ this ->resolver ->expects ($ this ->once ())->method ('resolve ' )->with ($ this ->equalTo ('example.com ' ))->willReturn ($ first ->promise ());
198202 $ pending = new Promise \Promise (function () { }, function () {
199- throw new \RuntimeException ('Connection cancelled ' );
203+ throw new \RuntimeException (
204+ 'Connection cancelled ' ,
205+ defined ('SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
206+ );
200207 });
201208 $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('1.2.3.4:80?hostname=example.com ' ))->willReturn ($ pending );
202209
@@ -205,7 +212,11 @@ public function testCancelDuringTcpConnectionCancelsTcpConnectionWithTcpRejectio
205212
206213 $ promise ->cancel ();
207214
208- $ this ->setExpectedException ('RuntimeException ' , 'Connection cancelled ' );
215+ $ this ->setExpectedException (
216+ 'RuntimeException ' ,
217+ 'Connection cancelled ' ,
218+ defined ('SOCKET_ECONNABORTED ' ) ? SOCKET_ECONNABORTED : 103
219+ );
209220 $ this ->throwRejection ($ promise );
210221 }
211222
0 commit comments