8000 minor #33877 Remove useless testCanCheckIfTerminalIsInteractive test … · dontub/symfony@718fb38 · GitHub
[go: up one dir, main page]

Skip to content
/ symfony Public
forked from symfony/symfony

Commit 718fb38

Browse files
minor symfony#33877 Remove useless testCanCheckIfTerminalIsInteractive test case (ostrolucky)
This PR was merged into the 3.4 branch. Discussion ---------- Remove useless testCanCheckIfTerminalIsInteractive test case | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | This test case does not work for following reasons: 1. `$inputStream` is `NULL`. `posix_isatty` happily swallows null and returns `true`. Test would have to use [CommandTester::setInputs](https://github.com/symfony/symfony/blob/ac4e9b0b265add48604c58a17d3c7593c0587614/src/Symfony/Component/Console/Tester/CommandTester.php#L66) or call `$tester->getInput()->setStream()` to fix this 1. Even if 1. is fixed, there are no internal `posix_isatty` calls going on. [ApplicationTester calls setInteractive only when such option is passed](https://github.com/symfony/symfony/blob/b0a32085887d0025aa84b39d2b12a57dc71e59ae/src/Symfony/Component/Console/Tester/ApplicationTester.php#L66), otherwise it will never be marked as interactive Commits ------- a84e4e0 Remove useless testCanCheckIfTerminalIsInteractive test case
2 parents 14ccaf5 + a84e4e0 commit 718fb38

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,23 +1587,6 @@ public function testSetRunCustomSingleComman 8000 d()
15871587
$this->assertStringContainsString('The foo:bar command', $tester->getDisplay());
15881588
}
15891589

1590-
/**
1591-
* @requires function posix_isatty
1592-
*/
1593-
public function testCanCheckIfTerminalIsInteractive()
1594-
{
1595-
$application = new CustomDefaultCommandApplication();
1596-
$application->setAutoExit(false);
1597-
1598-
$tester = new ApplicationTester($application);
1599-
$tester->run(['command' => 'help']);
1600-
1601-
$this->assertFalse($tester->getInput()->hasParameterOption(['--no-interaction', '-n']));
1602-
1603-
$inputStream = $tester->getInput()->getStream();
1604-
$this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream));
1605-
}
1606-
16071590
public function testRunLazyCommandService()
16081591
{
16091592
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)
0