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

Issue colors #1457

Closed
wants to merge 3 commits into from
Closed

Issue colors #1457

wants to merge 3 commits into from

Conversation

remicollet
Copy link
Contributor

The "colors" option allow to create nice output.
But lot of projects use it, and it create very bad output when the result is redirected to a file.

Here is 2 proposal

  • add a --nocolor option (so we can use it when needed, instead of having to change to configuration file)
  • add a check to only allow this option when output is a tty.

This PR is opened against, 4.3, but I will understand if you consider it only in 4.4+

@sebastianbergmann
Copy link
Owner

A change like this would have to go into master for PHPUnit 4.5. However, I am reluctant to add new CLI switches such as --no-colors.

However, I would accept a pull request for the 4.4 branch that introduces the function_exists("posix_isatty") && !posix_isatty(STDOUT) check.

@remicollet
Copy link
Contributor Author

Done, see PR #1458
Closing this one

@remicollet remicollet closed this Oct 6, 2014
@llaville
Copy link

llaville commented Oct 6, 2014

Hello Remi, Sebastian

You should also think to have both Linux and Windows platform compatible solution.
TIP: Symfony Console Component have a such function. See hasColorSupport function

@sebastianbergmann
Copy link
Owner

Yes, at some point in the future I want to reimplement the CLI test runner based on Symfony Console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants