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

--debug flag has no effect when using --stderr #719

Closed
wenslayer opened this issue Nov 15, 2012 · 9 comments
Closed

--debug flag has no effect when using --stderr #719

wenslayer opened this issue Nov 15, 2012 · 9 comments

Comments

@wenslayer
Copy link

In trying to work around the "headers already sent" problem, I'm using --stderr to get my tests to pass. Unfortunately, using --stderr seems to disable the --debug flag I'm also passing to see the details of which tests are running at a given point.

I couldn't find any mention that these flags were incompatible -- are they? If so, should the help be updated? If they should be compatible, perhaps this is a bug then?

Thanks for your help,
-Marc

@edorian
Copy link
Contributor

edorian commented Nov 24, 2012

Yeah. Using --stderr doesn't honor --debug the way it's implemented.

To try if it solves your problem you can edit TextUI/Command.php:420 and add the debug flag there

new PHPUnit_TextUI_ResultPrinter(   
     'php://stderr',                            
     isset($this->arguments['verbose']) ? $this->arguments['verbose'] : FALSE , false, true
);

Making the result printer honor --color and --stderr would just mean moving the argument handing out of the big arg processing loop.

@edorian
Copy link
Contributor

edorian commented Nov 24, 2012

@sebastianbergmann I've 'polluted' the arguments array with this. I don't think this is an issue but if it is tell me and I'll pull the flag out into a simple variable

@silverbadge
Copy link

In version 4.1.4, it seems to honour --stderr in the command line but not the config 'stderr="true"'.

@euoia
Copy link

euoia commented Dec 4, 2014

@edorian I am seeing the same thing as @silverbadge in 4.3.5. My stderr="true" is in my XML config. Using --debug on the command does not show the test names as hoped.

@Frug
Copy link

Frug commented Dec 12, 2014

@silverbadge 's situation got me too. --stderr and --debug seems ok, but stderr in the xml config silences debug. This behaviour seems inconsistent.

@euoia
Copy link

euoia commented Jan 14, 2015

@edorian perhaps we should consider reopening this?

@henriquemoody
Copy link
Contributor

Which version are you using @euoia? A lot of things changed since 302b465, maybe this bug got back before ea1fea3.

Ps.: When/if #1550 get merged we can create PHPT tests to avoid this behaviour come back.

@euoia
Copy link

euoia commented Jan 14, 2015

@henriquemoody

phpunit --version
PHPUnit 4.4.1 by Sebastian Bergmann.

@whatthejeff
Copy link
Contributor

@henriquemoody @euoia I think the original issue only concerned the CLI options. Feel free to open a new issue, though.

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

No branches or pull requests

7 participants