Improving compatobility method detection in paintError, so the failing line and method is correctly pointed out in the reporter

This commit is contained in:
José Lorenzo Rodríguez 2010-05-13 00:48:03 -04:30
parent 72959e7872
commit 01e36ce2c4

View file

@ -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 "<li class='fail'>\n";
echo "<span>Failed</span>";