@@ -103,7 +103,7 @@ public function testThatAnyOtherPendingConnectionAttemptsWillBeCanceledOnceAConn
103
103
public function testPassByResolverIfGivenIp ()
104
104
{
105
105
$ 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 )));
107
107
108
108
$ this ->connector ->connect ('127.0.0.1:80 ' );
109
109
@@ -113,7 +113,7 @@ public function testPassByResolverIfGivenIp()
113
113
public function testPassByResolverIfGivenIpv6 ()
114
114
{
115
115
$ 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 ' ) )));
117
117
118
118
$ this ->connector ->connect ('[::1]:80 ' );
119
119
@@ -123,7 +123,7 @@ public function testPassByResolverIfGivenIpv6()
123
123
public function testPassThroughResolverIfGivenHost ()
124
124
{
125
125
$ 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 ' ) )));
127
127
128
128
$ this ->connector ->connect ('google.com:80 ' );
129
129
@@ -133,7 +133,7 @@ public function testPassThroughResolverIfGivenHost()
133
133
public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6 ()
134
134
{
135
135
$ 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 ' ) )));
137
137
138
138
$ this ->connector ->connect ('google.com:80 ' );
139
139
@@ -143,7 +143,7 @@ public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6()
143
143
public function testPassByResolverIfGivenCompleteUri ()
144
144
{
145
145
$ 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 ' ) )));
147
147
148
148
$ this ->connector ->connect ('scheme://127.0.0.1:80/path?query#fragment ' );
149
149
@@ -153,7 +153,7 @@ public function testPassByResolverIfGivenCompleteUri()
153
153
public function testPassThroughResolverIfGivenCompleteUri ()
154
154
{
155
155
$ 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 ' ) )));
157
157
158
158
$ this ->connector ->connect ('scheme://google.com:80/path?query#fragment ' );
159
159
@@ -163,7 +163,7 @@ public function testPassThroughResolverIfGivenCompleteUri()
163
163
public function testPassThroughResolverIfGivenExplicitHost ()
164
164
{
165
165
$ 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 ' ) )));
167
167
168
168
$ this ->connector ->connect ('scheme://google.com:80/?hostname=google.de ' );
169
169
@@ -184,7 +184,7 @@ public function testIpv6ResolvesFirstSoIsTheFirstToConnect(array $ipv6, array $i
184
184
$ this ->returnValue (Promise \resolve ($ ipv6 )),
185
185
$ this ->returnValue ($ deferred ->promise ())
186
186
);
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 ' ) )));
188
188
189
189
$ this ->connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
190
190
@@ -209,7 +209,7 @@ public function testIpv6DoesntResolvesWhileIpv4DoesFirstSoIpv4Connects(array $ip
209
209
$ this ->returnValue ($ deferred ->promise ()),
210
210
$ this ->returnValue (Promise \resolve ($ ipv4 ))
211
211
);
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 ' ) )));
213
213
214
214
$ this ->connector ->connect ('scheme://google.com:80/?hostname=google.com ' );
215
215
0 commit comments