33namespace React \Tests \Stream ;
44
55use React \Stream \CompositeStream ;
6- use React \Stream \ReadableStream ;
7- use React \Stream \WritableStream ;
6+ use React \Stream \ThroughStream ;
87
98/**
109 * @covers React\Stream\CompositeStream
@@ -105,8 +104,8 @@ public function closeShouldCloseBothStreams()
105104 /** @test */
106105 public function itShouldForwardCloseOnlyOnce ()
107106 {
108- $ readable = new ReadableStream ();
109- $ writable = new WritableStream ();
107+ $ readable = new ThroughStream ();
108+ $ writable = new ThroughStream ();
110109
111110 $ composite = new CompositeStream ($ readable , $ writable );
112111 $ composite ->on ('close ' , $ this ->expectCallableOnce ());
@@ -118,8 +117,8 @@ public function itShouldForwardCloseOnlyOnce()
118117 /** @test */
119118 public function itShouldReceiveForwardedEvents ()
120119 {
121- $ readable = new ReadableStream ();
122- $ writable = new WritableStream ();
120+ $ readable = new ThroughStream ();
121+ $ writable = new ThroughStream ();
123122
124123 $ composite = new CompositeStream ($ readable , $ writable );
125124 $ composite ->on ('data ' , $ this ->expectCallableOnce ());
@@ -142,7 +141,7 @@ public function itShouldHandlePipingCorrectly()
142141
143142 $ composite = new CompositeStream ($ readable , $ writable );
144143
145- $ input = new ReadableStream ();
144+ $ input = new ThroughStream ();
146145 $ input ->pipe ($ composite );
147146 $ input ->emit ('data ' , array ('foo ' ));
148147 }
@@ -157,7 +156,7 @@ public function itShouldForwardPauseUpstreamWhenPipedTo()
157156
158157 $ composite = new CompositeStream ($ readable , $ writable );
159158
160- $ input = $ this ->getMockBuilder ('React\Stream\ReadableStream ' )->setMethods (array ('pause ' , 'resume ' ))->getMock ();
159+ $ input = $ this ->getMockBuilder ('React\Stream\ThroughStream ' )->setMethods (array ('pause ' , 'resume ' ))->getMock ();
161160 $ input
162161 ->expects ($ this ->once ())
163162 ->method ('pause ' );
@@ -176,7 +175,7 @@ public function itShouldForwardResumeUpstreamWhenPipedTo()
176175
177176 $ composite = new CompositeStream ($ readable , $ writable );
178177
179- $ input = $ this ->getMockBuilder ('React\Stream\ReadableStream ' )->setMethods (array ('pause ' , 'resume ' ))->getMock ();
178+ $ input = $ this ->getMockBuilder ('React\Stream\ThroughStream ' )->setMethods (array ('pause ' , 'resume ' ))->getMock ();
180179 $ input
181180 ->expects ($ this ->once ())
182181 ->method ('resume ' );
@@ -189,15 +188,12 @@ public function itShouldForwardResumeUpstreamWhenPipedTo()
189188 public function itShouldForwardPauseAndResumeUpstreamWhenPipedTo ()
190189 {
191190 $ readable = $ this ->getMockBuilder ('React\Stream\ReadableStreamInterface ' )->getMock ();
192- $ writable = $ this ->getMockBuilder ('React\Stream\WritableStream ' )->setMethods (array ('write ' ))->getMock ();
193- $ writable
194- ->expects ($ this ->once ())
195- ->method ('write ' )
196- ->will ($ this ->returnValue (false ));
191+ $ writable = new ThroughStream ();
192+ $ writable ->pause ();
197193
198194 $ composite = new CompositeStream ($ readable , $ writable );
199195
200- $ input = $ this ->getMockBuilder ('React\Stream\ReadableStream ' )->setMethods (array ('pause ' , 'resume ' ))->getMock ();
196+ $ input = $ this ->getMockBuilder ('React\Stream\ThroughStream ' )->setMethods (array ('pause ' , 'resume ' ))->getMock ();
201197 $ input
202198 ->expects ($ this ->once ())
203199 ->method ('pause ' );
@@ -213,7 +209,7 @@ public function itShouldForwardPauseAndResumeUpstreamWhenPipedTo()
213209 /** @test */
214210 public function itShouldForwardPipeCallsToReadableStream ()
215211 {
216- $ readable = new ReadableStream ();
212+ $ readable = new ThroughStream ();
217213 $ writable = $ this ->getMockBuilder ('React\Stream\WritableStreamInterface ' )->getMock ();
218214 $ writable ->expects ($ this ->any ())->method ('isWritable ' )->willReturn (True );
219215 $ composite = new CompositeStream ($ readable , $ writable );
0 commit comments