@@ -81,7 +81,7 @@ public function testPassByResolverIfGivenIp()
8181    public  function  testPassByResolverIfGivenIpv6 ()
8282    {
8383        $ this resolver ->expects ($ this never ())->method ('resolveAll ' );
84-         $ this tcp ->expects ($ this once ())->method ('connect ' )->with ($ this equalTo ('[::1]:80 ' ))->will ($ this returnValue (Promise \reject
84+         $ this tcp ->expects ($ this once ())->method ('connect ' )->with ($ this equalTo ('[::1]:80 ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
8585
8686        $ this connector ->connect ('[::1]:80 ' );
8787
@@ -91,7 +91,7 @@ public function testPassByResolverIfGivenIpv6()
9191    public  function  testPassThroughResolverIfGivenHost ()
9292    {
9393        $ this resolver ->expects ($ this exactly (2 ))->method ('resolveAll ' )->with ($ this equalTo ('google.com ' ), $ this anything ())->will ($ this returnValue (Promise \resolvearray ('1.2.3.4 ' ))));
94-         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('1.2.3.4:80?hostname=google.com ' ))->will ($ this returnValue (Promise \reject
94+         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('1.2.3.4:80?hostname=google.com ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
9595
9696        $ this connector ->connect ('google.com:80 ' );
9797
@@ -101,7 +101,7 @@ public function testPassThroughResolverIfGivenHost()
101101    public  function  testPassThroughResolverIfGivenHostWhichResolvesToIpv6 ()
102102    {
103103        $ this resolver ->expects ($ this exactly (2 ))->method ('resolveAll ' )->with ($ this equalTo ('google.com ' ), $ this anything ())->will ($ this returnValue (Promise \resolvearray ('::1 ' ))));
104-         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('[::1]:80?hostname=google.com ' ))->will ($ this returnValue (Promise \reject
104+         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('[::1]:80?hostname=google.com ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
105105
106106        $ this connector ->connect ('google.com:80 ' );
107107
@@ -111,7 +111,7 @@ public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6()
111111    public  function  testPassByResolverIfGivenCompleteUri ()
112112    {
113113        $ this resolver ->expects ($ this never ())->method ('resolveAll ' );
114-         $ this tcp ->expects ($ this once ())->method ('connect ' )->with ($ this equalTo ('scheme://127.0.0.1:80/path?query#fragment ' ))->will ($ this returnValue (Promise \reject
114+         $ this tcp ->expects ($ this once ())->method ('connect ' )->with ($ this equalTo ('scheme://127.0.0.1:80/path?query#fragment ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
115115
116116        $ this connector ->connect ('scheme://127.0.0.1:80/path?query#fragment ' );
117117
@@ -121,7 +121,7 @@ public function testPassByResolverIfGivenCompleteUri()
121121    public  function  testPassThroughResolverIfGivenCompleteUri ()
122122    {
123123        $ this resolver ->expects ($ this exactly (2 ))->method ('resolveAll ' )->with ($ this equalTo ('google.com ' ), $ this anything ())->will ($ this returnValue (Promise \resolvearray ('1.2.3.4 ' ))));
124-         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('scheme://1.2.3.4:80/path?query&hostname=google.com#fragment ' ))->will ($ this returnValue (Promise \reject
124+         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('scheme://1.2.3.4:80/path?query&hostname=google.com#fragment ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
125125
126126        $ this connector ->connect ('scheme://google.com:80/path?query#fragment ' );
127127
@@ -131,7 +131,7 @@ public function testPassThroughResolverIfGivenCompleteUri()
131131    public  function  testPassThroughResolverIfGivenExplicitHost ()
132132    {
133133        $ this resolver ->expects ($ this exactly (2 ))->method ('resolveAll ' )->with ($ this equalTo ('google.com ' ), $ this anything ())->will ($ this returnValue (Promise \resolvearray ('1.2.3.4 ' ))));
134-         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('scheme://1.2.3.4:80/?hostname=google.de ' ))->will ($ this returnValue (Promise \reject
134+         $ this tcp ->expects ($ this exactly (2 ))->method ('connect ' )->with ($ this equalTo ('scheme://1.2.3.4:80/?hostname=google.de ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
135135
136136        $ this connector ->connect ('scheme://google.com:80/?hostname=google.de ' );
137137
@@ -171,12 +171,12 @@ public function testIpv6ResolvesFirstSoIsTheFirstToConnect(array $ipv6, array $i
171171
172172        $ this resolver ->expects ($ this at (0 ))->method ('resolveAll ' )->with ('google.com ' , Message::TYPE_AAAA )->will ($ this returnValue (Promise \resolve$ ipv6
173173        $ this resolver ->expects ($ this at (1 ))->method ('resolveAll ' )->with ('google.com ' , Message::TYPE_A )->will ($ this returnValue ($ deferredpromise ()));
174-         $ this tcp ->expects ($ this any ())->method ('connect ' )->with ($ this stringContains (']:80/?hostname=google.com ' ))->will ($ this returnValue (Promise \reject
174+         $ this tcp ->expects ($ this any ())->method ('connect ' )->with ($ this stringContains (']:80/?hostname=google.com ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
175175
176176        $ this connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
177177
178178        $ this loop ->addTimer (0.07 , function  () use  ($ deferred
179-             $ deferredreject ();
179+             $ deferredreject (new  \ Exception ( ' reject ' ) );
180180        });
181181
182182        $ this loop ->run ();
@@ -191,12 +191,12 @@ public function testIpv6DoesntResolvesWhileIpv4DoesFirstSoIpv4Connects(array $ip
191191
192192        $ this resolver ->expects ($ this at (0 ))->method ('resolveAll ' )->with ('google.com ' , Message::TYPE_AAAA )->will ($ this returnValue ($ deferredpromise ()));
193193        $ this resolver ->expects ($ this at (1 ))->method ('resolveAll ' )->with ('google.com ' , Message::TYPE_A )->will ($ this returnValue (Promise \resolve$ ipv4
194-         $ this tcp ->expects ($ this any ())->method ('connect ' )->with ($ this stringContains (':80/?hostname=google.com ' ))->will ($ this returnValue (Promise \reject
194+         $ this tcp ->expects ($ this any ())->method ('connect ' )->with ($ this stringContains (':80/?hostname=google.com ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
195195
196196        $ this connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
197197
198198        $ this loop ->addTimer (0.07 , function  () use  ($ deferred
199-             $ deferredreject ();
199+             $ deferredreject (new  \ Exception ( ' reject ' ) );
200200        });
201201
202202        $ this loop ->run ();
@@ -290,10 +290,10 @@ public function testAttemptsToConnectBothIpv6AndIpv4AddressesAlternatingIpv6AndI
290290        $ i0 ;
291291        while  (count ($ ipv60  || count ($ ipv40 ) {
292292            if  (count ($ ipv60 ) {
293-                 $ this tcp ->expects ($ this at ($ imethod ('connect ' )->with ($ this equalTo ('scheme://[ '  . array_shift ($ ipv6']:80/?hostname=google.com ' ))->will ($ this returnValue (Promise \reject
293+                 $ this tcp ->expects ($ this at ($ imethod ('connect ' )->with ($ this equalTo ('scheme://[ '  . array_shift ($ ipv6']:80/?hostname=google.com ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
294294            }
295295            if  (count ($ ipv40 ) {
296-                 $ this tcp ->expects ($ this at ($ imethod ('connect ' )->with ($ this equalTo ('scheme:// '  . array_shift ($ ipv4':80/?hostname=google.com ' ))->will ($ this returnValue (Promise \reject
296+                 $ this tcp ->expects ($ this at ($ imethod ('connect ' )->with ($ this equalTo ('scheme:// '  . array_shift ($ ipv4':80/?hostname=google.com ' ))->will ($ this returnValue (Promise \rejectnew  \ Exception ( ' reject ' ) )));
297297            }
298298        }
299299
0 commit comments