@@ -23,12 +23,14 @@ public function itShouldCloseReadableIfNotWritable()
23
23
$ readable
24
24
->expects ($ this ->once ())
25
25
->method ('close ' );
26
+ assert ($ readable instanceof ReadableStreamInterface);
26
27
27
28
$ writable = $ this ->createMock (WritableStreamInterface::class);
28
29
$ writable
29
30
->expects ($ this ->once ())
30
31
->method ('isWritable ' )
31
32
->willReturn (false );
33
+ assert ($ writable instanceof WritableStreamInterface);
32
34
33
35
$ composite = new CompositeStream ($ readable , $ writable );
34
36
@@ -44,11 +46,13 @@ public function itShouldCloseWritableIfNotReadable()
44
46
->expects ($ this ->once ())
45
47
->method ('isReadable ' )
46
48
->willReturn (false );
49
+ assert ($ readable instanceof ReadableStreamInterface);
47
50
48
51
$ writable = $ this ->createMock (WritableStreamInterface::class);
49
52
$ writable
50
53
->expects ($ this ->once ())
51
54
->method ('close ' );
55
+ assert ($ writable instanceof WritableStreamInterface);
52
56
53
57
$ composite = new CompositeStream ($ readable , $ writable );
54
58
@@ -64,6 +68,7 @@ public function itShouldForwardWritableCallsToWritableStream()
64
68
->expects ($ this ->once ())
65
69
->method ('isReadable ' )
66
70
->willReturn (true );
71
+ assert ($ readable instanceof ReadableStreamInterface);
67
72
68
73
$ writable = $ this ->createMock (WritableStreamInterface::class);
69
74
$ writable
@@ -74,6 +79,7 @@ public function itShouldForwardWritableCallsToWritableStream()
74
79
->expects ($ this ->exactly (2 ))
75
80
->method ('isWritable ' )
76
81
->willReturn (true );
82
+ assert ($ writable instanceof WritableStreamInterface);
77
83
78
84
$ composite = new CompositeStream ($ readable , $ writable );
79
85
$ composite ->write ('foo ' );
@@ -94,12 +100,14 @@ public function itShouldForwardReadableCallsToReadableStream()
94
100
$ readable
95
101
->expects ($ this ->once ())
96
102
->method ('resume ' );
103
+ assert ($ readable instanceof ReadableStreamInterface);
97
104
98
105
$ writable = $ this ->createMock (WritableStreamInterface::class);
99
106
$ writable
100
107
->expects ($ this ->any ())
101
108
->method ('isWritable ' )
102
109
->willReturn (true );
110
+ assert ($ writable instanceof WritableStreamInterface);
103
111
104
112
$ composite = new CompositeStream ($ readable , $ writable );
105
113
$ composite ->isReadable ();
@@ -118,12 +126,14 @@ public function itShouldNotForwardResumeIfStreamIsNotWritable()
118
126
$ readable
119
127
->expects ($ this ->never ())
120
128
->method ('resume ' );
129
+ assert ($ readable instanceof ReadableStreamInterface);
121
130
122
131
$ writable = $ this ->createMock (WritableStreamInterface::class);
123
132
$ writable
124
133
->expects ($ this ->exactly (2 ))
125
134
->method ('isWritable ' )
126
135
->willReturnOnConsecutiveCalls (true , false );
136
+ assert ($ writable instanceof WritableStreamInterface);
127
137
128
138
$ composite = new CompositeStream ($ readable , $ writable );
129
139
$ composite ->resume ();
@@ -137,6 +147,7 @@ public function endShouldDelegateToWritableWithData()
137
147
->expects ($ this ->once ())
138
148
->method ('isReadable ' )
139
149
->willReturn (true );
150
+ assert ($ readable instanceof ReadableStreamInterface);
140
151
141
152
$ writable = $ this ->createMock (WritableStreamInterface::class);
142
153
$ writable
@@ -147,6 +158,7 @@ public function endShouldDelegateToWritableWithData()
147
158
->expects ($ this ->once ())
148
159
->method ('end ' )
149
160
->with ('foo ' );
161
+ assert ($ writable instanceof WritableStreamInterface);
150
162
151
163
$ composite = new CompositeStream ($ readable , $ writable );
152
164
$ composite ->end ('foo ' );
@@ -163,6 +175,7 @@ public function closeShouldCloseBothStreams()
163
175
$ readable
164
176
->expects ($ this ->once ())
165
177
->method ('close ' );
178
+ assert ($ readable instanceof ReadableStreamInterface);
166
179
167
180
$ writable = $ this ->createMock (WritableStreamInterface::class);
168
181
$ writable
@@ -172,6 +185,7 @@ public function closeShouldCloseBothStreams()
172
185
$ writable
173
186
->expects ($ this ->once ())
174
187
->method ('close ' );
188
+ assert ($ writable instanceof WritableStreamInterface);
175
189
176
190
$ composite = new CompositeStream ($ readable , $ writable );
177
191
$ composite ->close ();
@@ -231,13 +245,15 @@ public function itShouldHandlePipingCorrectly()
231
245
->expects ($ this ->once ())
232
246
->method ('isReadable ' )
233
247
->willReturn (true );
248
+ assert ($ readable instanceof ReadableStreamInterface);
234
249
235
250
$ writable = $ this ->createMock (WritableStreamInterface::class);
236
251
$ writable ->expects ($ this ->any ())->method ('isWritable ' )->willReturn (True );
237
252
$ writable
238
253
->expects ($ this ->once ())
239
254
->method ('write ' )
240
255
->with ('foo ' );
256
+ assert ($ writable instanceof WritableStreamInterface);
241
257
242
258
$ composite = new CompositeStream ($ readable , $ writable );
243
259
@@ -253,6 +269,7 @@ public function itShouldForwardPipeCallsToReadableStream()
253
269
254
270
$ writable = $ this ->createMock (WritableStreamInterface::class);
255
271
$ writable ->expects ($ this ->any ())->method ('isWritable ' )->willReturn (True );
272
+ assert ($ writable instanceof WritableStreamInterface);
256
273
257
274
$ composite = new CompositeStream ($ readable , $ writable );
258
275
@@ -262,6 +279,7 @@ public function itShouldForwardPipeCallsToReadableStream()
262
279
->expects ($ this ->once ())
263
280
->method ('write ' )
264
281
->with ('foo ' );
282
+ assert ($ output instanceof WritableStreamInterface);
265
283
266
284
$ composite ->pipe ($ output );
267
285
$ readable ->emit ('data ' , ['foo ' ]);
0 commit comments