Permalink
Browse files

- Merge [5115:5117] to close #672.

  • Loading branch information...
sebastianbergmann committed Aug 18, 2009
1 parent b720268 commit 63e468b50581deafa1a27795560780150d890268
Showing with 13 additions and 1 deletion.
  1. +1 −0 PHPUnit/Tests/TextUI/help.phpt
  2. +1 −0 PHPUnit/Tests/TextUI/help2.phpt
  3. +10 −0 PHPUnit/TextUI/Command.php
  4. +1 −1 PHPUnit/Util/Printer.php
@@ -37,6 +37,7 @@ Usage: phpunit [switches] UnitTest [UnitTest.php]
--testdox Report test execution progress in TestDox format.
--colors Use colors in output.
+ --stderr Write to STDERR instead of STDOUT.
--stop-on-failure Stop execution upon first error or failure.
--verbose Output more verbose information.
--wait Waits for a keystroke after each test.
@@ -40,6 +40,7 @@ Usage: phpunit [switches] UnitTest [UnitTest.php]
--testdox Report test execution progress in TestDox format.
--colors Use colors in output.
+ --stderr Write to STDERR instead of STDOUT.
--stop-on-failure Stop execution upon first error or failure.
--verbose Output more verbose information.
--wait Waits for a keystroke after each test.
View
@@ -116,6 +116,7 @@ class PHPUnit_TextUI_Command
'skeleton' => NULL,
'skeleton-class' => NULL,
'skeleton-test' => NULL,
+ 'stderr' => NULL,
'stop-on-failure' => NULL,
'story' => NULL,
'story-html=' => NULL,
@@ -484,6 +485,14 @@ protected function handleArguments(array $argv)
}
break;
+ case '--stderr': {
+ $this->arguments['printer'] = new PHPUnit_TextUI_ResultPrinter(
+ 'php://stderr',
+ isset($this->arguments['verbose']) ? $this->arguments['verbose'] : FALSE
+ );
+ }
+ break;
+
case '--stop-on-failure': {
$this->arguments['stopOnFailure'] = TRUE;
}
@@ -915,6 +924,7 @@ protected function showHelp()
--testdox Report test execution progress in TestDox format.
--colors Use colors in output.
+ --stderr Write to STDERR instead of STDOUT.
--stop-on-failure Stop execution upon first error or failure.
--verbose Output more verbose information.
--wait Waits for a keystroke after each test.
View
@@ -119,7 +119,7 @@ public function __construct($out = NULL)
*/
public function flush()
{
- if ($this->out !== NULL) {
+ if ($this->out !== NULL && $this->outTarget !== 'php://stderr') {
fclose($this->out);
}

0 comments on commit 63e468b

Please sign in to comment.