diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index c868580f7..8c07e9b45 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -265,7 +265,16 @@ class CakeHtmlReporter extends CakeBaseReporter { echo "
" . $this->_htmlEntities($message->toString()); if ((is_string($actualMsg) && is_string($expectedMsg)) || (is_array($actualMsg) && is_array($expectedMsg))) { - echo "
" . $this->_htmlEntities(PHPUnit_Util_Diff::diff($expectedMsg, $actualMsg)); + + $diffs = ""; + if (class_exists('PHPUnit_Util_Diff')) { + $diffs = PHPUnit_Util_Diff::diff($expectedMsg, $actualMsg); + } elseif (class_exists('SebastianBergmann\Diff\Differ')) { + $differ = new SebastianBergmann\Diff\Differ(); + $diffs = $differ->diff($expectedMsg, $actualMsg); + } + + echo "
" . $this->_htmlEntities($diffs); } echo "