only try to get comparison failure for the appropriate object

This commit is contained in:
euromark 2012-07-21 15:23:54 +02:00
parent a7865b5d1d
commit 6557e3bafe

View file

@ -249,10 +249,12 @@ class CakeHtmlReporter extends CakeBaseReporter {
$testName = get_class($test) . '(' . $test->getName() . ')'; $testName = get_class($test) . '(' . $test->getName() . ')';
$actualMsg = $expectedMsg = null; $actualMsg = $expectedMsg = null;
$failure = $message->getComparisonFailure(); if (method_exists($message, 'comparisonFailure')) {
if (is_object($failure)) { $failure = $message->comparisonFailure();
$actualMsg = $message->getComparisonFailure()->getActualAsString(); if (is_object($failure)) {
$expectedMsg = $message->getComparisonFailure()->getExpectedAsString(); $actualMsg = $message->getComparisonFailure()->getActualAsString();
$expectedMsg = $message->getComparisonFailure()->getExpectedAsString();
}
} }
echo "<li class='fail'>\n"; echo "<li class='fail'>\n";