1
0
Fork 0
mirror of synced 2025-04-01 20:36:14 +03:00

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

This commit is contained in:
meus 2007-07-23 19:22:13 +00:00
parent 489687318a
commit 239c842233

View file

@ -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()