File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 10
10
"react/dns" : " 0.4.*" ,
11
11
"react/event-loop" : " 0.4.*" ,
12
12
"react/stream" : " 0.4.*" ,
13
+ "react/promise" : " ~2.2" ,
13
14
"evenement/evenement" : " ~2.0"
14
15
},
15
16
"autoload" : {
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public function writeHead()
59
59
60
60
$ this
61
61
->connect ()
62
- ->then (
62
+ ->done (
63
63
function ($ stream ) use ($ requestData , &$ streamRef , &$ stateRef ) {
64
64
$ streamRef = $ stream ;
65
65
Original file line number Diff line number Diff line change @@ -219,6 +219,25 @@ public function requestShouldEmitErrorIfConnectionEmitsError()
219
219
$ request ->handleError (new \Exception ('test ' ));
220
220
}
221
221
222
+ /**
223
+ * @test
224
+ * @expectedException Exception
225
+ * @expectedExceptionMessage something failed
226
+ */
227
+ public function requestDoesNotHideErrors ()
228
+ {
229
+ $ requestData = new RequestData ('GET ' , 'http://www.example.com ' );
230
+ $ request = new Request ($ this ->connector , $ requestData );
231
+
232
+ $ this ->rejectedConnectionMock ();
233
+
234
+ $ request ->on ('error ' , function () {
235
+ throw new \Exception ('something failed ' );
236
+ });
237
+
238
+ $ request ->end ();
239
+ }
240
+
222
241
/** @test */
223
242
public function postRequestShouldSendAPostRequest ()
224
243
{
You can’t perform that action at this time.
0 commit comments