Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix spacing

Instead of adding a newline after printing any content, now the new content
prints the newline for it! This makes calculating the spacing easier.
  • Loading branch information...
commit 0859cd4bdd75d9a5dd8e6efc9f6fd6545651c04d 1 parent 2b7d9dd
@Maher4Ever authored
View
16 PHPUnit/Extensions/Progress/ResultPrinter.php
@@ -39,7 +39,7 @@ public function __construct($out = NULL, $verbose = FALSE, $colors = FALSE, $deb
*/
public function printResult(PHPUnit_Framework_TestResult $result)
{
- print "\n\n";
+ print "\n";
if ($result->errorCount() > 0) {
$this->printErrors($result);
@@ -83,7 +83,7 @@ protected function printDefects(array $defects, $count, $type)
return;
}
- $this->write($type . ":\n");
+ $this->write("\n" . $type . ":\n");
$i = 1;
$failOrError = $type == 'Failures' || $type == 'Errors';
@@ -129,7 +129,7 @@ protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $cou
if ( $failOrError ) {
$this->write(
sprintf(
- "\n %d) %s\n",
+ "\n %d) %s",
$count,
$testName
@@ -137,7 +137,7 @@ protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $cou
);
} else {
$this->write(
- sprintf( " %s\n", $this->yellow($testName) )
+ sprintf( " %s", $this->yellow($testName) )
);
}
}
@@ -154,7 +154,7 @@ protected function printDefectBody(PHPUnit_Framework_TestFailure $defect, $count
if ( !empty($error) ) {
$error = explode("\n", $error);
- $error = $padding . implode("\n " . $padding , $error) . "\n";
+ $error = "\n" . $padding . implode("\n " . $padding , $error);
$this->write( $failOrError ? $this->red($error) : $this->cyan($error) );
}
@@ -174,9 +174,9 @@ protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect, $padd
if ( ! empty($trace) ) {
$trace = explode("\n", $trace);
- $trace = $padding . '# ' . implode("\n${padding}# ", $trace);
+ $trace = "\n" . $padding . '# ' . implode("\n${padding}# ", $trace);
- $this->write($this->cyan($trace) . "\n");
+ $this->write($this->cyan($trace));
}
}
@@ -235,7 +235,7 @@ protected function printSkipped(PHPUnit_Framework_TestResult $result)
protected function printFooter(PHPUnit_Framework_TestResult $result)
{
- $this->write( sprintf("Finished in %s\n", PHP_Timer::timeSinceStartOfRequest()) );
+ $this->write( sprintf("\nFinished in %s\n", PHP_Timer::timeSinceStartOfRequest()) );
$resultsCount = count($result);
View
6 Tests/printer_errors_variation.phpt
@@ -18,9 +18,9 @@ PHPUnit_TextUI_Command::main();
Errors:
- 1) NumberTest::testMathStillWorks
-[31m NumberException: Division by zero!
-[0m[36m # %s:%i
+ 1) NumberTest::testMathStillWorks[31m
+ NumberException: Division by zero![0m[36m
+ # %s:%i
# %s:%i
# %s:%i
View
1  Tests/printer_failing.phpt
@@ -22,7 +22,6 @@ Failures:
# %s:%i
# %s:%i
-
2) NumberTest::testThatMyMathTeacherSuckedEvenMore
Failed asserting that 'I don't know!' is identical to -1.
# %s:%i
View
13 Tests/printer_failing_variation.phpt
@@ -18,15 +18,14 @@ PHPUnit_TextUI_Command::main();
Failures:
- 1) NumberTest::testThatMyMathTeacherSucked
-[31m Failed asserting that 10 is identical to 1.
-[0m[36m # %s:%i
+ 1) NumberTest::testThatMyMathTeacherSucked[31m
+ Failed asserting that 10 is identical to 1.[0m[36m
+ # %s:%i
# %s:%i
-
- 2) NumberTest::testThatMyMathTeacherSuckedEvenMore
- Failed asserting that 'I don't know!' is identical to -1.
- # %s:%i
+ 2) NumberTest::testThatMyMathTeacherSuckedEvenMore
+ Failed asserting that 'I don't know!' is identical to -1.
+ # %s:%i
# %s:%i
Finished in %i second%S
Please sign in to comment.
Something went wrong with that request. Please try again.