Permalink
Browse files

More PHPUnit_Framework_ComparisonFailure_String tweakage.

  • Loading branch information...
1 parent e5aee8b commit eaa187211a56de97dc1c1b1eb3b4670150ca7707 @sebastianbergmann committed Sep 21, 2006
Showing with 13 additions and 4 deletions.
  1. +13 −4 PHPUnit/TextUI/ResultPrinter.php
@@ -200,12 +200,21 @@ protected function printDefectTrace(PHPUnit_Framework_TestFailure $defect)
if ($e instanceof PHPUnit_Framework_ExpectationFailedException) {
$comparisonFailure = $e->getComparisonFailure();
- if ($this->verbose || $comparisonFailure instanceof PHPUnit_Framework_ComparisonFailure_String) {
+ $string = '';
+
+ if ($this->verbose ||
+ $comparisonFailure instanceof PHPUnit_Framework_ComparisonFailure_String) {
$string = $comparisonFailure->toString();
+ }
+
+ if (!$this->verbose &&
+ $comparisonFailure instanceof PHPUnit_Framework_ComparisonFailure_String &&
+ strpos($string, 'expected string <') !== FALSE) {
+ $string = '';
+ }
- if (!empty($string)) {
- $this->write($string . "\n");
- }
+ if (!empty($string)) {
+ $this->write($string . "\n");
}
}
}

0 comments on commit eaa1872

Please sign in to comment.