/** * @requires function posix_isatty */ public function testCanCheckIfTerminalIsInteractive() { $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)); }