@@ -168,29 +168,7 @@ public function testWriteAfterReadlineInputWillClearReadlineWriteOutputAndRestor
168168 $ buffer .= $ data ;
169169 }));
170170
171- $ stdio ->writeln ('test ' );
172-
173- $ this ->assertEquals ("\r\033[K " . "test \n" . "> input " , $ buffer );
174- }
175-
176- public function testWriteLineWillClearReadlineWriteOutputAndRestoreReadline ()
177- {
178- $ input = $ this ->getMockBuilder ('React\Stream\ReadableStreamInterface ' )->getMock ();
179- $ output = $ this ->getMockBuilder ('React\Stream\WritableStreamInterface ' )->getMock ();
180-
181- //$readline = $this->getMockBuilder('Clue\React\Stdio\Readline')->disableOriginalConstructor()->getMock();
182- $ readline = new Readline ($ input , $ output );
183- $ readline ->setPrompt ('> ' );
184- $ readline ->setInput ('input ' );
185-
186- $ stdio = new Stdio ($ this ->loop , $ input , $ output , $ readline );
187-
188- $ buffer = '' ;
189- $ output ->expects ($ this ->any ())->method ('write ' )->will ($ this ->returnCallback (function ($ data ) use (&$ buffer ) {
190- $ buffer .= $ data ;
191- }));
192-
193- $ stdio ->writeln ('test ' );
171+ $ stdio ->write ("test \n" );
194172
195173 $ this ->assertEquals ("\r\033[K " . "test \n" . "> input " , $ buffer );
196174 }
@@ -212,8 +190,8 @@ public function testWriteTwoLinesWillClearReadlineWriteOutputAndRestoreReadline(
212190 $ buffer .= $ data ;
213191 }));
214192
215- $ stdio ->writeln ( ' hello ' );
216- $ stdio ->writeln ( ' world ' );
193+ $ stdio ->write ( " hello \n" );
194+ $ stdio ->write ( " world \n" );
217195
218196 $ this ->assertEquals ("\r\033[K " . "hello \n" . "> input " . "\r\033[K " . "world \n" . "> input " , $ buffer );
219197 }
0 commit comments