public function ApplicationTest::testCanCheckIfTerminalIsInteractive in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Tests/ApplicationTest.php \Symfony\Component\Console\Tests\ApplicationTest::testCanCheckIfTerminalIsInteractive()
File
- vendor/
symfony/ console/ Tests/ ApplicationTest.php, line 1005
Class
Namespace
Symfony\Component\Console\TestsCode
public function testCanCheckIfTerminalIsInteractive() {
if (!function_exists('posix_isatty')) {
$this
->markTestSkipped('posix_isatty function is required');
}
$application = new CustomDefaultCommandApplication();
$application
->setAutoExit(false);
$tester = new ApplicationTester($application);
$tester
->run(array(
'command' => 'help',
));
$this
->assertFalse($tester
->getInput()
->hasParameterOption(array(
'--no-interaction',
'-n',
)));
$inputStream = $application
->getHelperSet()
->get('question')
->getInputStream();
$this
->assertEquals($tester
->getInput()
->isInteractive(), @posix_isatty($inputStream));
}