11<?php
22
33use React \Promise \Stream ;
4- use React \Stream \ReadableStream ;
5- use React \Stream \WritableStream ;
4+ use React \Stream \ThroughStream ;
65
76class FirstTest extends TestCase
87{
98 public function testClosedReadableStreamRejects ()
109 {
11- $ stream = new ReadableStream ();
10+ $ stream = new ThroughStream ();
1211 $ stream ->close ();
1312
1413 $ promise = Stream \first ($ stream );
@@ -18,7 +17,7 @@ public function testClosedReadableStreamRejects()
1817
1918 public function testClosedWritableStreamRejects ()
2019 {
21- $ stream = new WritableStream ();
20+ $ stream = new ThroughStream ();
2221 $ stream ->close ();
2322
2423 $ promise = Stream \first ($ stream );
@@ -28,7 +27,7 @@ public function testClosedWritableStreamRejects()
2827
2928 public function testPendingStreamWillNotResolve ()
3029 {
31- $ stream = new ReadableStream ();
30+ $ stream = new ThroughStream ();
3231
3332 $ promise = Stream \first ($ stream );
3433
@@ -37,7 +36,7 @@ public function testPendingStreamWillNotResolve()
3736
3837 public function testClosingStreamRejects ()
3938 {
40- $ stream = new ReadableStream ();
39+ $ stream = new ThroughStream ();
4140 $ promise = Stream \first ($ stream );
4241
4342 $ stream ->close ();
@@ -47,7 +46,7 @@ public function testClosingStreamRejects()
4746
4847 public function testClosingWritableStreamRejects ()
4948 {
50- $ stream = new WritableStream ();
49+ $ stream = new ThroughStream ();
5150 $ promise = Stream \first ($ stream );
5251
5352 $ stream ->close ();
@@ -57,7 +56,7 @@ public function testClosingWritableStreamRejects()
5756
5857 public function testClosingStreamResolvesWhenWaitingForCloseEvent ()
5958 {
60- $ stream = new ReadableStream ();
59+ $ stream = new ThroughStream ();
6160 $ promise = Stream \first ($ stream , 'close ' );
6261
6362 $ stream ->close ();
@@ -67,7 +66,7 @@ public function testClosingStreamResolvesWhenWaitingForCloseEvent()
6766
6867 public function testEmittingDataOnStreamResolvesWithFirstEvent ()
6968 {
70- $ stream = new ReadableStream ();
69+ $ stream = new ThroughStream ();
7170 $ promise = Stream \first ($ stream );
7271
7372 $ stream ->emit ('data ' , array ('hello ' , $ stream ));
@@ -79,7 +78,7 @@ public function testEmittingDataOnStreamResolvesWithFirstEvent()
7978
8079 public function testEmittingErrorOnStreamDoesNothing ()
8180 {
82- $ stream = new ReadableStream ();
81+ $ stream = new ThroughStream ();
8382 $ promise = Stream \first ($ stream );
8483
8584 $ stream ->emit ('error ' , array (new \RuntimeException ('test ' )));
@@ -89,7 +88,7 @@ public function testEmittingErrorOnStreamDoesNothing()
8988
9089 public function testEmittingErrorResolvesWhenWaitingForErrorEvent ()
9190 {
92- $ stream = new ReadableStream ();
91+ $ stream = new ThroughStream ();
9392 $ promise = Stream \first ($ stream , 'error ' );
9493
9594 $ stream ->emit ('error ' , array (new \RuntimeException ('test ' )));
@@ -99,7 +98,7 @@ public function testEmittingErrorResolvesWhenWaitingForErrorEvent()
9998
10099 public function testCancelPendingStreamWillReject ()
101100 {
102- $ stream = new ReadableStream ();
101+ $ stream = new ThroughStream ();
103102
104103 $ promise = Stream \first ($ stream );
105104
0 commit comments