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 ...@@ -16,18 +16,19 @@ class GroupTest extends UnitTestCase
} }
public function run(HtmlReporter $reporter) public function run(HtmlReporter $reporter)
{ {
$reporter->paintHeader();
foreach ($this->_testCases as $k => $testCase) { foreach ($this->_testCases as $k => $testCase) {
$testCase->run(); $testCase->run();
$this->_passed += $testCase->getPassCount(); $this->_passed += $testCase->getPassCount();
$this->_failed += $testCase->getFailCount(); $this->_failed += $testCase->getFailCount();
$this->_messages += $testCase->getMessages(); $this->_messages = array_merge($this->_messages, $testCase->getMessages());
$this->_testCases[$k] = null; $this->_testCases[$k] = null;
} }
$reporter->setTestCase($this); $reporter->setTestCase($this);
$reporter->paintHeader();
$reporter->paintFooter(); $reporter->paintFooter();
} }
...@@ -113,7 +114,6 @@ class UnitTestCase ...@@ -113,7 +114,6 @@ class UnitTestCase
foreach ($trace as $stack) { foreach ($trace as $stack) {
if (substr($stack['function'], 0, 4) === 'test') { if (substr($stack['function'], 0, 4) === 'test') {
$class = new ReflectionClass($stack['class']); $class = new ReflectionClass($stack['class']);
...@@ -121,13 +121,12 @@ class UnitTestCase ...@@ -121,13 +121,12 @@ class UnitTestCase
$line = $stack['line']; $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; break;
} }
$line = $stack['line']; $line = $stack['line'];
} }
$this->_failed++; $this->_failed++;
} }
public function run() 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