From 01e36ce2c48fb59e86ba9d44915fe403f91336a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez?= Date: Thu, 13 May 2010 00:48:03 -0430 Subject: [PATCH] Improving compatobility method detection in paintError, so the failing line and method is correctly pointed out in the reporter --- cake/tests/lib/reporter/cake_html_reporter.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 9f6f8eea7..ff128bc2f 100755 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -264,7 +264,13 @@ class CakeHtmlReporter extends CakeBaseReporter { public function paintFail($message) { $context = $message->getTrace(); $realContext = $context[3]; - $context = $context[2]; + $class = new ReflectionClass($realContext['class']); + if ($class->getParentClass()->getName() === 'PHPUnit_Framework_TestCase') { + $realContext = $context[4]; + $context = $context[3]; + } else { + $context = $context[2]; + } echo "
  • \n"; echo "Failed";