You are here

public function LegacyDialogHelperTest::testAsk in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php \Symfony\Component\Console\Tests\Helper\LegacyDialogHelperTest::testAsk()

File

vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php, line 57

Class

LegacyDialogHelperTest
@group legacy

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testAsk() {
  $dialog = new DialogHelper();
  $dialog
    ->setInputStream($this
    ->getInputStream("\n8AM\n"));
  $this
    ->assertEquals('2PM', $dialog
    ->ask($this
    ->getOutputStream(), 'What time is it?', '2PM'));
  $this
    ->assertEquals('8AM', $dialog
    ->ask($output = $this
    ->getOutputStream(), 'What time is it?', '2PM'));
  rewind($output
    ->getStream());
  $this
    ->assertEquals('What time is it?', stream_get_contents($output
    ->getStream()));
}