Adds an error to the list of errors.
PHPUnit_Framework_Test $test:
Exception $e:
float $time:
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
if ($e instanceof PHPUnit_Framework_IncompleteTest) {
$this->notImplemented[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addIncompleteTest';
if ($this->stopOnIncomplete) {
$this
->stop();
}
}
else {
if ($e instanceof PHPUnit_Framework_SkippedTest) {
$this->skipped[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addSkippedTest';
if ($this->stopOnSkipped) {
$this
->stop();
}
}
else {
$this->errors[] = new PHPUnit_Framework_TestFailure($test, $e);
$notifyMethod = 'addError';
if ($this->stopOnError || $this->stopOnFailure) {
$this
->stop();
}
}
}
foreach ($this->listeners as $listener) {
$listener
->{$notifyMethod}($test, $e, $time);
}
$this->lastTestFailed = TRUE;
$this->time += $time;
}