diff --git a/src/Framework/Dumper.php b/src/Framework/Dumper.php index 0dcf4c8f..07607125 100644 --- a/src/Framework/Dumper.php +++ b/src/Framework/Dumper.php @@ -311,6 +311,7 @@ public static function dumpException($e) return $s; } + /** * @param AssertException $assertException * @param string $testFile @@ -337,7 +338,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi for ($i = 0; $i < strlen($actual) && isset($expected[$i]) && $actual[$i] === $expected[$i]; $i++) ; for (; $i && $i < strlen($actual) && $actual[$i - 1] >= "\x80" && $actual[$i] >= "\x80" && $actual[$i] < "\xC0"; $i--) ; $i = max(0, min( - $i - (int)(self::$maxLength / 3), // try to display 1/3 of shorter string + $i - (int) (self::$maxLength / 3), // try to display 1/3 of shorter string max(strlen($actual), strlen($expected)) - self::$maxLength + 3 // 3 = length of ... )); if ($i) { @@ -352,8 +353,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi ) { if (($delta = strlen($m[1]) - strlen($m[3])) >= 3) { $message = "$m[1]$m[2]\n" . str_repeat(' ', $delta - 3) . "...$m[3]$m[4]"; - } - else { + } else { $message = "$m[1]$m[2]$m[3]\n" . str_repeat(' ', strlen($m[1]) - 4) . "... $m[4]"; } } @@ -364,6 +364,7 @@ public static function storeAssertDiff(AssertException $assertException, $testFi ]); } + /** * Dumps data to folder 'output'. * @return string diff --git a/src/Runner/OutputHandler.php b/src/Runner/OutputHandler.php index 404840e0..1f455d79 100644 --- a/src/Runner/OutputHandler.php +++ b/src/Runner/OutputHandler.php @@ -7,7 +7,6 @@ namespace Tester\Runner; -use Tester; /**