Skip to content
This repository
Browse code

only try to get comparison failure for the appropriate object

  • Loading branch information...
commit 6557e3bafe6fe0dfcaa8dd5d654309cac12120a1 1 parent a7865b5
Mark authored July 21, 2012
10  lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
@@ -249,10 +249,12 @@ public function paintFail($message, $test) {
249 249
 		$testName = get_class($test) . '(' . $test->getName() . ')';
250 250
 
251 251
 		$actualMsg = $expectedMsg = null;
252  
-		$failure = $message->getComparisonFailure();
253  
-		if (is_object($failure)) {
254  
-			$actualMsg = $message->getComparisonFailure()->getActualAsString();
255  
-			$expectedMsg = $message->getComparisonFailure()->getExpectedAsString();
  252
+		if (method_exists($message, 'comparisonFailure')) {
  253
+			$failure = $message->comparisonFailure();
  254
+			if (is_object($failure)) {
  255
+				$actualMsg = $message->getComparisonFailure()->getActualAsString();
  256
+				$expectedMsg = $message->getComparisonFailure()->getExpectedAsString();
  257
+			}
256 258
 		}
257 259
 
258 260
 		echo "<li class='fail'>\n";

0 notes on commit 6557e3b

Please sign in to comment.
Something went wrong with that request. Please try again.