@@ -103,7 +103,7 @@ public function testThatAnyOtherPendingConnectionAttemptsWillBeCanceledOnceAConn
103103 public function testPassByResolverIfGivenIp ()
104104 {
105105 $ this ->resolver ->expects ($ this ->never ())->method ('resolveAll ' );
106- $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('127.0.0.1:80 ' ))->will ($ this ->returnValue (Promise \resolve ()));
106+ $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('127.0.0.1:80 ' ))->will ($ this ->returnValue (Promise \resolve (null )));
107107
108108 $ this ->connector ->connect ('127.0.0.1:80 ' );
109109
@@ -113,7 +113,7 @@ public function testPassByResolverIfGivenIp()
113113 public function testPassByResolverIfGivenIpv6 ()
114114 {
115115 $ this ->resolver ->expects ($ this ->never ())->method ('resolveAll ' );
116- $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('[::1]:80 ' ))->will ($ this ->returnValue (Promise \reject ()));
116+ $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('[::1]:80 ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
117117
118118 $ this ->connector ->connect ('[::1]:80 ' );
119119
@@ -123,7 +123,7 @@ public function testPassByResolverIfGivenIpv6()
123123 public function testPassThroughResolverIfGivenHost ()
124124 {
125125 $ 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 ' ))));
126- $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('1.2.3.4:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
126+ $ 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 ' ) )));
127127
128128 $ this ->connector ->connect ('google.com:80 ' );
129129
@@ -133,7 +133,7 @@ public function testPassThroughResolverIfGivenHost()
133133 public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6 ()
134134 {
135135 $ this ->resolver ->expects ($ this ->exactly (2 ))->method ('resolveAll ' )->with ($ this ->equalTo ('google.com ' ), $ this ->anything ())->will ($ this ->returnValue (Promise \resolve (array ('::1 ' ))));
136- $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('[::1]:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
136+ $ this ->tcp ->expects ($ this ->exactly (2 ))->method ('connect ' )->with ($ this ->equalTo ('[::1]:80?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
137137
138138 $ this ->connector ->connect ('google.com:80 ' );
139139
@@ -143,7 +143,7 @@ public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6()
143143 public function testPassByResolverIfGivenCompleteUri ()
144144 {
145145 $ this ->resolver ->expects ($ this ->never ())->method ('resolveAll ' );
146- $ this ->tcp ->expects ($ this ->once ())->method ('connect ' )->with ($ this ->equalTo ('scheme://127.0.0.1:80/path?query#fragment ' ))->will ($ this ->returnValue (Promise \reject ()));
146+ $ 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 ' ) )));
147147
148148 $ this ->connector ->connect ('scheme://127.0.0.1:80/path?query#fragment ' );
149149
@@ -153,7 +153,7 @@ public function testPassByResolverIfGivenCompleteUri()
153153 public function testPassThroughResolverIfGivenCompleteUri ()
154154 {
155155 $ 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 ' ))));
156- $ 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 ()));
156+ $ 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 ' ) )));
157157
158158 $ this ->connector ->connect ('scheme://google.com:80/path?query#fragment ' );
159159
@@ -163,7 +163,7 @@ public function testPassThroughResolverIfGivenCompleteUri()
163163 public function testPassThroughResolverIfGivenExplicitHost ()
164164 {
165165 $ 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 ' ))));
166- $ 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 ()));
166+ $ 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 ' ) )));
167167
168168 $ this ->connector ->connect ('scheme://google.com:80/?hostname=google.de ' );
169169
@@ -184,7 +184,7 @@ public function testIpv6ResolvesFirstSoIsTheFirstToConnect(array $ipv6, array $i
184184 $ this ->returnValue (Promise \resolve ($ ipv6 )),
185185 $ this ->returnValue ($ deferred ->promise ())
186186 );
187- $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (']:80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
187+ $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (']:80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
188188
189189 $ this ->connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
190190
@@ -209,7 +209,7 @@ public function testIpv6DoesntResolvesWhileIpv4DoesFirstSoIpv4Connects(array $ip
209209 $ this ->returnValue ($ deferred ->promise ()),
210210 $ this ->returnValue (Promise \resolve ($ ipv4 ))
211211 );
212- $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (':80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject ()));
212+ $ this ->tcp ->expects ($ this ->any ())->method ('connect ' )->with ($ this ->stringContains (':80/?hostname=google.com ' ))->will ($ this ->returnValue (Promise \reject (new \ Exception ( ' reject ' ) )));
213213
214214 $ this ->connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
215215
0 commit comments