Skip to content

Commit

Permalink
only try to get comparison failure for the appropriate object
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Jul 21, 2012
1 parent a7865b5 commit 6557e3b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
Expand Up @@ -249,10 +249,12 @@ public function paintFail($message, $test) {
$testName = get_class($test) . '(' . $test->getName() . ')';

$actualMsg = $expectedMsg = null;
$failure = $message->getComparisonFailure();
if (is_object($failure)) {
$actualMsg = $message->getComparisonFailure()->getActualAsString();
$expectedMsg = $message->getComparisonFailure()->getExpectedAsString();
if (method_exists($message, 'comparisonFailure')) {
$failure = $message->comparisonFailure();
if (is_object($failure)) {
$actualMsg = $message->getComparisonFailure()->getActualAsString();
$expectedMsg = $message->getComparisonFailure()->getExpectedAsString();
}
}

echo "<li class='fail'>\n";
Expand Down

0 comments on commit 6557e3b

Please sign in to comment.