Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless testCanCheckIfTerminalIsInteractive test case #33877

Merged
merged 1 commit into from Oct 7, 2019

Conversation

@ostrolucky
Copy link
Contributor

commented Oct 6, 2019

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 or call $tester->getInput()->setStream() to fix this
  2. Even if 1. is fixed, there are no internal posix_isatty calls going on. ApplicationTester calls setInteractive only when such option is passed, otherwise it will never be marked as interactive
@ostrolucky ostrolucky force-pushed the ostrolucky:remove-useless-test branch from 8541527 to 14ccaf5 Oct 6, 2019
@ostrolucky ostrolucky force-pushed the ostrolucky:remove-useless-test branch from 71b24e4 to a84e4e0 Oct 6, 2019
@ostrolucky ostrolucky changed the base branch from 4.4 to 3.4 Oct 6, 2019
@ostrolucky

This comment has been minimized.

Copy link
Contributor Author

commented Oct 6, 2019

test failures unrelated

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Oct 7, 2019
@nicolas-grekas

This comment has been minimized.

Copy link
Member

commented Oct 7, 2019

Thank you @ostrolucky.

nicolas-grekas added a commit that referenced this pull request Oct 7, 2019
…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
@nicolas-grekas nicolas-grekas merged commit a84e4e0 into symfony:3.4 Oct 7, 2019
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
fabbot.io Your code looks good.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.