-
Notifications
You must be signed in to change notification settings - Fork 62
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
Replace echo to flushable stdout #33
base: master
Are you sure you want to change the base?
Conversation
This was sent in #19 too before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Andras! Thank you for submitting this PR. Could you better help me understand this use case for a custom printer? Why are they useful and what problem does this PR solve?
Why is stdout a better way of outputting the report? If I recall correctly, PHPUnit itself uses echo
to print to terminal.
When would a developer want to use stderr
instead of stdout
?
Does outPath
support all file paths? How does this feature respond when the file path is not writeable, not openable, or does not exist?
@@ -302,6 +334,8 @@ protected function renderFooter() | |||
*/ | |||
protected function loadOptions(array $options) | |||
{ | |||
$this->outPath = isset($options['outPath']) ? $options['outPath'] : 'php://stdout'; | |||
$this->forceFlush = isset($options['forceFlush']) ? $options['forceFlush'] : False; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use lower-case false
instead of capitalized False
per PSR-2 standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for my mistake, I fixed this
575438d
to
575f14e
Compare
Dear @johnkary , On our several systems we can't change buffering strategy, and the only one solution for continuous - In other hand, the So, I tried to implement the flushing in your stuff, but I couldn't reach the flushing without writing - There looked good a freely configurable output when I wrote the So this is the history/reason of these two arguments. |
575f14e
to
9207fe9
Compare
Dear @johnkary, |
Where we sticked @johnkary? Should I help you? |
@andras-tim Sorry, very busy with paid work. Will have time to look closer sometime in May. |
@johnkary, is there any news? |
ping |
@andras-tim I've begun looking at this and looks like it will work! I'll give it a final look using a custom result printer to be sure. In the meantime I tried using your changes to phpunit-speedtrap with whatthejeff/nyancat-phpunit-resultprinter, the PHPUnit results printer that prints Nyancat output for test results. That library didn't support PHPUnit 6 yet so I fixed it and PR'd 😋 |
Thank you @johnkary! |
@johnkary, is there any news? |
Added outPath and forceFlush arguments FYI: This is useful, when a custom phpunit printer explicit flushes its results.
9207fe9
to
0bad4b6
Compare
Added
outPath
andforceFlush
argumentsFYI:
This is useful, when a custom
phpunit
printer explicit flushes its results.