Commit 239c8422 authored by meus's avatar meus

Fixed testrunner so that it prints out all errors. also fixed a CLI reporter ann a HTML reporter

parent 48968731
......@@ -16,18 +16,19 @@ class GroupTest extends UnitTestCase
}
public function run(HtmlReporter $reporter)
{
$reporter->paintHeader();
foreach ($this->_testCases as $k => $testCase) {
$testCase->run();
$this->_passed += $testCase->getPassCount();
$this->_failed += $testCase->getFailCount();
$this->_messages += $testCase->getMessages();
$this->_messages = array_merge($this->_messages, $testCase->getMessages());
$this->_testCases[$k] = null;
}
$reporter->setTestCase($this);
$reporter->paintHeader();
$reporter->paintFooter();
}
......@@ -113,7 +114,6 @@ class UnitTestCase
foreach ($trace as $stack) {
if (substr($stack['function'], 0, 4) === 'test') {
$class = new ReflectionClass($stack['class']);
......@@ -121,13 +121,12 @@ class UnitTestCase
$line = $stack['line'];
}
$this->_messages[] = $class->getName() . ' : method ' . $stack['function'] . ' failed on line ' . $line;
$errorMessage = $class->getName() . ' : method ' . $stack['function'] . ' failed on line ' . $line;
$this->_messages[] = $errorMessage;
break;
}
$line = $stack['line'];
}
$this->_failed++;
}
public function run()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment