diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index 27599a64a..ac622e2e2 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -248,9 +248,22 @@ class CakeHtmlReporter extends CakeBaseReporter { $trace = $this->_getStackTrace($message); $testName = get_class($test) . '(' . $test->getName() . ')'; + $failure = $message->getComparisonFailure(); + if (is_object($failure)) { + $actualMsg = $message->getComparisonFailure()->getActualAsString(); + $expectedMsg = $message->getComparisonFailure()->getExpectedAsString(); + } + echo "
  • \n"; echo "Failed"; - echo "
    " . $this->_htmlEntities($message->toString()) . "
    \n"; + echo "
    " . $this->_htmlEntities($message->toString());
    +
    +
    +		if ((is_string($actualMsg) && is_string($expectedMsg)) || (is_array($actualMsg) && is_array($expectedMsg))) {
    +		  echo "
    " . PHPUnit_Util_Diff::diff($expectedMsg, $actualMsg); + } + + echo "
    \n"; echo "
    " . __d('cake_dev', 'Test case: %s', $testName) . "
    \n"; echo "
    " . __d('cake_dev', 'Stack trace:') . '
    ' . $trace . "
    \n"; echo "
  • \n";