mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #11017 from peloncano/2.x
PHPUnit_Util_Diff class not found fix
This commit is contained in:
commit
dca1289eef
1 changed files with 10 additions and 1 deletions
|
@ -265,7 +265,16 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
|||
echo "<div class='msg'><pre>" . $this->_htmlEntities($message->toString());
|
||||
|
||||
if ((is_string($actualMsg) && is_string($expectedMsg)) || (is_array($actualMsg) && is_array($expectedMsg))) {
|
||||
echo "<br />" . $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 "<br />" . $this->_htmlEntities($diffs);
|
||||
}
|
||||
|
||||
echo "</pre></div>\n";
|
||||
|
|
Loading…
Reference in a new issue