From 22baf7fd450149d5c908dc9b1e9ae8a60ce1045f Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 21 Jun 2010 22:47:41 -0400 Subject: [PATCH] Fixing fatal errors that would arise if the Exception did not have a parent class. --- cake/tests/lib/reporter/cake_html_reporter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cake/tests/lib/reporter/cake_html_reporter.php b/cake/tests/lib/reporter/cake_html_reporter.php index 7de522721..c857916a5 100755 --- a/cake/tests/lib/reporter/cake_html_reporter.php +++ b/cake/tests/lib/reporter/cake_html_reporter.php @@ -265,7 +265,11 @@ class CakeHtmlReporter extends CakeBaseReporter { $context = $message->getTrace(); $realContext = $context[3]; $class = new ReflectionClass($realContext['class']); - $deeper = $class->getParentClass()->getName() === 'PHPUnit_Framework_TestCase'; + + $deeper = false; + if ($class->getParentClass()) { + $deeper = $class->getParentClass()->getName() === 'PHPUnit_Framework_TestCase'; + } $deeper = $deeper || !$class->isSubclassOf('PHPUnit_Framework_TestCase'); if ($deeper) { $realContext = $context[4];