|
16 | 16 | use Symfony\Component\Console\Exception\RuntimeException; |
17 | 17 | use Symfony\Component\Console\Formatter\OutputFormatter; |
18 | 18 | use Symfony\Component\Console\Input\ArrayInput; |
19 | | -use Symfony\Component\Console\Input\Input; |
20 | 19 | use Symfony\Component\Console\Input\InputInterface; |
21 | 20 | use Symfony\Component\Console\Output\ConsoleOutputInterface; |
22 | 21 | use Symfony\Component\Console\Output\ConsoleSectionOutput; |
23 | 22 | use Symfony\Component\Console\Output\NullOutput; |
24 | 23 | use Symfony\Component\Console\Output\OutputInterface; |
25 | | -use Symfony\Component\Console\Output\StreamOutput; |
26 | 24 | use Symfony\Component\Console\Style\SymfonyStyle; |
27 | 25 | use Symfony\Component\Console\Tester\CommandTester; |
28 | 26 |
|
@@ -183,38 +181,4 @@ public function testMemoryConsumption() |
183 | 181 |
|
184 | 182 | $this->assertSame(0, memory_get_usage() - $start); |
185 | 183 | } |
186 | | - |
187 | | - public function testAskAndClearExpectFullSectionCleared() |
188 | | - { |
189 | | - $answer = 'Answer'; |
190 | | - $inputStream = fopen('php://memory', 'r+'); |
191 | | - fwrite($inputStream, $answer.\PHP_EOL); |
192 | | - rewind($inputStream); |
193 | | - $input = $this->createMock(Input::class); |
194 | | - $sections = []; |
195 | | - $output = new ConsoleSectionOutput(fopen('php://memory', 'r+', false), $sections, StreamOutput::VERBOSITY_NORMAL, true, new OutputFormatter()); |
196 | | - $input |
197 | | - ->method('isInteractive') |
198 | | - ->willReturn(true); |
199 | | - $input |
200 | | - ->method('getStream') |
201 | | - ->willReturn($inputStream); |
202 | | - |
203 | | - $style = new SymfonyStyle($input, $output); |
204 | | - |
205 | | - $style->write('foo'); |
206 | | - $givenAnswer = $style->ask('Dummy question?'); |
207 | | - $output->write('bar'); |
208 | | - $output->clear(); |
209 | | - |
210 | | - rewind($output->getStream()); |
211 | | - $this->assertEquals($answer, $givenAnswer); |
212 | | - $this->assertEquals( |
213 | | - 'foo'.\PHP_EOL. // write foo |
214 | | - \PHP_EOL.\PHP_EOL.\PHP_EOL." \033[32mDummy question?\033[39m:".\PHP_EOL.' > '.\PHP_EOL.\PHP_EOL.\PHP_EOL. // question |
215 | | - 'bar'.\PHP_EOL. // write bar |
216 | | - "\033[10A\033[0J", // clear 10 lines (9 output lines and one from the answer input return) |
217 | | - stream_get_contents($output->getStream()) |
218 | | - ); |
219 | | - } |
220 | 184 | } |
0 commit comments