@@ -133,7 +133,7 @@ public function testExecInspectBeforeRunning($exec)
133133 */
134134 public function testExecStartWhileRunning ($ exec )
135135 {
136- $ promise = $ this ->client ->execStart ($ exec, true );
136+ $ promise = $ this ->client ->execStart ($ exec );
137137 $ output = Block \await ($ promise , $ this ->loop );
138138
139139 $ this ->assertEquals ('hello world ' , $ output );
@@ -165,7 +165,7 @@ public function testExecStringCommandWithOutputWhileRunning($container)
165165 $ this ->assertTrue (is_array ($ exec ));
166166 $ this ->assertTrue (is_string ($ exec ['Id ' ]));
167167
168- $ promise = $ this ->client ->execStart ($ exec ['Id ' ], true );
168+ $ promise = $ this ->client ->execStart ($ exec ['Id ' ]);
169169 $ output = Block \await ($ promise , $ this ->loop );
170170
171171 $ this ->assertEquals ('hello world ' , $ output );
@@ -177,13 +177,13 @@ public function testExecStringCommandWithOutputWhileRunning($container)
177177 */
178178 public function testExecUserSpecificCommandWithOutputWhileRunning ($ container )
179179 {
180- $ promise = $ this ->client ->execCreate ($ container , 'whoami ' , true , false , true , true , 'nobody ' );
180+ $ promise = $ this ->client ->execCreate ($ container , 'whoami ' , false , false , true , true , 'nobody ' );
181181 $ exec = Block \await ($ promise , $ this ->loop );
182182
183183 $ this ->assertTrue (is_array ($ exec ));
184184 $ this ->assertTrue (is_string ($ exec ['Id ' ]));
185185
186- $ promise = $ this ->client ->execStart ($ exec ['Id ' ], true );
186+ $ promise = $ this ->client ->execStart ($ exec ['Id ' ]);
187187 $ output = Block \await ($ promise , $ this ->loop );
188188
189189 $ this ->assertEquals ('nobody ' , rtrim ($ output ));
@@ -195,18 +195,39 @@ public function testExecUserSpecificCommandWithOutputWhileRunning($container)
195195 */
196196 public function testExecStringCommandWithStderrOutputWhileRunning ($ container )
197197 {
198- $ promise = $ this ->client ->execCreate ($ container , 'echo -n hello world >&2 ' , true );
198+ $ promise = $ this ->client ->execCreate ($ container , 'echo -n hello world >&2 ' );
199199 $ exec = Block \await ($ promise , $ this ->loop );
200200
201201 $ this ->assertTrue (is_array ($ exec ));
202202 $ this ->assertTrue (is_string ($ exec ['Id ' ]));
203203
204- $ promise = $ this ->client ->execStart ($ exec ['Id ' ], true );
204+ $ promise = $ this ->client ->execStart ($ exec ['Id ' ]);
205205 $ output = Block \await ($ promise , $ this ->loop );
206206
207207 $ this ->assertEquals ('hello world ' , $ output );
208208 }
209209
210+ /**
211+ * @depends testStartRunning
212+ * @param string $container
213+ */
214+ public function testExecStreamCommandWithTtyAndStderrOutputWhileRunning ($ container )
215+ {
216+ $ promise = $ this ->client ->execCreate ($ container , 'echo -n hello world >&2 ' , true );
217+ $ exec = Block \await ($ promise , $ this ->loop );
218+
219+ $ this ->assertTrue (is_array ($ exec ));
220+ $ this ->assertTrue (is_string ($ exec ['Id ' ]));
221+
222+ $ stream = $ this ->client ->execStartStream ($ exec ['Id ' ], true );
223+ //$stream->on('data', $this->expectCallableOnce());
224+ //$stream->on('end', $this->expectCallableOnce());
225+
226+ $ output = Block \await (Stream \buffer ($ stream ), $ this ->loop );
227+
228+ $ this ->assertEquals ('hello world ' , $ output );
229+ }
230+
210231 /**
211232 * @depends testStartRunning
212233 * @param string $container
0 commit comments