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

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

Projects

None yet

7 participants

@wenslayer

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
Collaborator
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 edorian added a commit that closed this issue Nov 24, 2012
@edorian edorian Fixes #719 302b465
@edorian edorian closed this in 302b465 Nov 24, 2012
@edorian
Collaborator
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

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

@euoia
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
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
euoia commented Jan 14, 2015

@edorian perhaps we should consider reopening this?

@henriquemoody
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
euoia commented Jan 14, 2015

@henriquemoody

phpunit --version
PHPUnit 4.4.1 by Sebastian Bergmann.
@whatthejeff
Collaborator

@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