@@ -84,7 +84,7 @@ public function testPassByResolverIfGivenIp()
8484 public function testPassByResolverIfGivenIpv6 ()
8585 {
8686 $ this ->resolver ->expects ($ this ->never ())->method ('resolveAll ' );
87- $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('[::1]:80 ' ))->will ($ this ->returnValue (Promise \reject ()));
87+ $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('[::1]:80 ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
8888
8989 $ this ->connector ->connect ('[::1]:80 ' );
9090
@@ -94,7 +94,7 @@ public function testPassByResolverIfGivenIpv6()
9494 public function testPassThroughResolverIfGivenHost ()
9595 {
9696 $ this ->resolver ->expects ($ this ->exactly (2 ))->method ('resolveAll ' )->with ($ this ->equalTo ('google.com ' ), $ this ->anything ())->will ($ this ->returnValue (Promise \resolve (array ('1.2.3.4 ' ))));
97- $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('1.2.3.4:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
97+ $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('1.2.3.4:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
9898
9999 $ this ->connector ->connect ('google.com:80 ' );
100100
@@ -104,7 +104,7 @@ public function testPassThroughResolverIfGivenHost()
104104 public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6 ()
105105 {
106106 $ this ->resolver ->expects ($ this ->exactly (2 ))->method ('resolveAll ' )->with ($ this ->equalTo ('google.com ' ), $ this ->anything ())->will ($ this ->returnValue (Promise \resolve (array ('::1 ' ))));
107- $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('[::1]:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
107+ $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('[::1]:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
108108
109109 $ this ->connector ->connect ('google.com:80 ' );
110110
@@ -114,7 +114,7 @@ public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6()
114114 public function testPassByResolverIfGivenCompleteUri ()
115115 {
116116 $ this ->resolver ->expects ($ this ->never ())->method ('resolveAll ' );
117- $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('scheme://127.0.0.1:80/path?query#fragment ' ))->will ($ this ->returnValue (Promise \reject ()));
117+ $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('scheme://127.0.0.1:80/path?query#fragment ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
118118
119119 $ this ->connector ->connect ('scheme://127.0.0.1:80/path?query#fragment ' );
120120
@@ -124,7 +124,7 @@ public function testPassByResolverIfGivenCompleteUri()
124124 public function testPassThroughResolverIfGivenCompleteUri ()
125125 {
126126 $ this ->resolver ->expects ($ this ->exactly (2 ))->method ('resolveAll ' )->with ($ this ->equalTo ('google.com ' ), $ this ->anything ())->will ($ this ->returnValue (Promise \resolve (array ('1.2.3.4 ' ))));
127- $ 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 ()));
127+ $ 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 (new \ Exception ( ' reject ' ) )));
128128
129129 $ this ->connector ->connect ('scheme://google.com:80/path?query#fragment ' );
130130
@@ -134,7 +134,7 @@ public function testPassThroughResolverIfGivenCompleteUri()
134134 public function testPassThroughResolverIfGivenExplicitHost ()
135135 {
136136 $ this ->resolver ->expects ($ this ->exactly (2 ))->method ('resolveAll ' )->with ($ this ->equalTo ('google.com ' ), $ this ->anything ())->will ($ this ->returnValue (Promise \resolve (array ('1.2.3.4 ' ))));
137- $ 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 ()));
137+ $ 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 (new \ Exception ( ' reject ' ) )));
138138
139139 $ this ->connector ->connect ('scheme://google.com:80/?hostname=google.de ' );
140140
@@ -155,12 +155,12 @@ public function testIpv6ResolvesFirstSoIsTheFirstToConnect(array $ipv6, array $i
155155 $ this ->returnValue (Promise \resolve ($ ipv6 )),
156156 $ this ->returnValue ($ deferred ->promise ())
157157 );
158- $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (']:80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
158+ $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (']:80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
159159
160160 $ this ->connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
161161
162162 $ this ->loop ->addTimer (0.07 , function () use ($ deferred ) {
163- $ deferred ->reject (new \RuntimeException ( ));
163+ $ deferred ->reject (new \Exception ( ' reject ' ));
164164 });
165165
166166 $ this ->loop ->run ();
@@ -180,12 +180,12 @@ public function testIpv6DoesntResolvesWhileIpv4DoesFirstSoIpv4Connects(array $ip
180180 $ this ->returnValue ($ deferred ->promise ()),
181181 $ this ->returnValue (Promise \resolve ($ ipv4 ))
182182 );
183- $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (':80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
183+ $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (':80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
184184
185185 $ this ->connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
186186
187187 $ this ->loop ->addTimer (0.07 , function () use ($ deferred ) {
188- $ deferred ->reject (new \RuntimeException ( ));
188+ $ deferred ->reject (new \Exception ( ' reject ' ));
189189 });
190190
191191 $ this ->loop ->run ();
0 commit comments