public function PHPUnit_Util_Log_JUnit::addError

An error occurred.

Parameters

PHPUnit_Framework_Test $test:

Exception $e:

float $time:

Overrides PHPUnit_Framework_TestListener::addError

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Log/JUnit.php, line 165

Class

PHPUnit_Util_Log_JUnit
A TestListener that generates a logfile of the test execution in XML markup.

Code

public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
  if ($this->currentTestCase !== NULL) {
    if ($test instanceof PHPUnit_Framework_SelfDescribing) {
      $buffer = $test
        ->toString() . "\n";
    }
    else {
      $buffer = '';
    }
    $buffer .= PHPUnit_Framework_TestFailure::exceptionToString($e) . "\n" . PHPUnit_Util_Filter::getFilteredStacktrace($e);
    $error = $this->document
      ->createElement('error', PHPUnit_Util_XML::prepareString($buffer));
    $error
      ->setAttribute('type', get_class($e));
    $this->currentTestCase
      ->appendChild($error);
    $this->testSuiteErrors[$this->testSuiteLevel]++;
  }
}