You are here

public function QuestionHelperTest::testAskConfirmation in Zircon Profile 8

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

@dataProvider getAskConfirmationData

File

vendor/symfony/console/Tests/Helper/QuestionHelperTest.php, line 155

Class

QuestionHelperTest
@group tty

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testAskConfirmation($question, $expected, $default = true) {
  $dialog = new QuestionHelper();
  $dialog
    ->setInputStream($this
    ->getInputStream($question . "\n"));
  $question = new ConfirmationQuestion('Do you like French fries?', $default);
  $this
    ->assertEquals($expected, $dialog
    ->ask($this
    ->createInputInterfaceMock(), $this
    ->createOutputInterface(), $question), 'confirmation question should ' . ($expected ? 'pass' : 'cancel'));
}