77use React \Promise ;
88use React \Promise \CancellablePromiseInterface ;
99use React \Promise \Deferred ;
10- use React \Stream \ReadableStream ;
10+ use React \Stream \ThroughStream ;
1111
1212class StreamingParserTest extends TestCase
1313{
@@ -20,7 +20,7 @@ public function setUp()
2020
2121 public function testJsonPassingRejectedPromiseResolvesWithClosedStream ()
2222 {
23- $ stream = $ this ->parser ->parseJsonStream (Promise \reject ());
23+ $ stream = $ this ->parser ->parseJsonStream (Promise \reject (new \ RuntimeException () ));
2424
2525 $ this ->assertInstanceOf ('React\Stream\ReadableStreamInterface ' , $ stream );
2626 $ this ->assertFalse ($ stream ->isReadable ());
@@ -62,7 +62,7 @@ public function testJsonResolvingPromiseWithWrongValueWillEmitErrorAndCloseEvent
6262
6363 public function testPlainPassingRejectedPromiseResolvesWithClosedStream ()
6464 {
65- $ stream = $ this ->parser ->parsePlainStream (Promise \reject ());
65+ $ stream = $ this ->parser ->parsePlainStream (Promise \reject (new \ RuntimeException () ));
6666
6767 $ this ->assertInstanceOf ('React\Stream\ReadableStreamInterface ' , $ stream );
6868 $ this ->assertFalse ($ stream ->isReadable ());
@@ -79,7 +79,7 @@ public function testDeferredClosedStreamWillReject()
7979
8080 public function testDeferredStreamEventsWillBeEmittedAndBuffered ()
8181 {
82- $ stream = new ReadableStream ();
82+ $ stream = new ThroughStream ();
8383
8484 $ promise = $ this ->parser ->deferredStream ($ stream );
8585
@@ -94,20 +94,20 @@ public function testDeferredStreamEventsWillBeEmittedAndBuffered()
9494
9595 public function testDeferredStreamErrorEventWillRejectPromise ()
9696 {
97- $ stream = new ReadableStream ();
97+ $ stream = new ThroughStream ();
9898
9999 $ promise = $ this ->parser ->deferredStream ($ stream );
100100
101101 $ stream ->emit ('ignored ' , array ('ignored ' ));
102102
103103 $ stream ->emit ('data ' , array ('a ' ));
104104
105- $ stream ->emit ('error ' , array (' value ' , ' ignord ' ));
105+ $ stream ->emit ('error ' , array (new \ RuntimeException () ));
106106
107107 $ stream ->close ();
108108
109109 $ this ->expectPromiseReject ($ promise );
110- $ promise ->then (null , $ this ->expectCallableOnceWith (' value ' ));
110+ $ promise ->then (null , $ this ->expectCallableOnceWith ($ this -> isInstanceOf ( ' RuntimeException ' ) ));
111111 }
112112
113113 public function testDeferredCancelingPromiseWillCloseStream ()
@@ -126,7 +126,7 @@ public function testDeferredCancelingPromiseWillCloseStream()
126126
127127 public function testDemultiplexStreamWillReturnReadable ()
128128 {
129- $ stream = new ReadableStream ();
129+ $ stream = new ThroughStream ();
130130
131131 $ out = $ this ->parser ->demultiplexStream ($ stream );
132132
0 commit comments