From 6557e3bafe6fe0dfcaa8dd5d654309cac12120a1 Mon Sep 17 00:00:00 2001 From: euromark Date: Sat, 21 Jul 2012 15:23:54 +0200 Subject: [PATCH] only try to get comparison failure for the appropriate object --- lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index 5bd2695ce..e05ee621a 100644 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -249,10 +249,12 @@ class CakeHtmlReporter extends CakeBaseReporter { $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 "
  • \n";