You are here

public function PHPUnit_Util_Log_JUnit::endTestSuite in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/phpunit/src/Util/Log/JUnit.php \PHPUnit_Util_Log_JUnit::endTestSuite()

A testsuite ended.

@since Method available since Release 2.2.0

Parameters

PHPUnit_Framework_TestSuite $suite:

Overrides PHPUnit_Framework_TestListener::endTestSuite

File

vendor/phpunit/phpunit/src/Util/Log/JUnit.php, line 313

Class

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

Code

public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
  $this->testSuites[$this->testSuiteLevel]
    ->setAttribute('tests', $this->testSuiteTests[$this->testSuiteLevel]);
  $this->testSuites[$this->testSuiteLevel]
    ->setAttribute('assertions', $this->testSuiteAssertions[$this->testSuiteLevel]);
  $this->testSuites[$this->testSuiteLevel]
    ->setAttribute('failures', $this->testSuiteFailures[$this->testSuiteLevel]);
  $this->testSuites[$this->testSuiteLevel]
    ->setAttribute('errors', $this->testSuiteErrors[$this->testSuiteLevel]);
  $this->testSuites[$this->testSuiteLevel]
    ->setAttribute('time', sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]));
  if ($this->testSuiteLevel > 1) {
    $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel];
    $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel];
    $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel];
    $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel];
    $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel];
  }
  $this->testSuiteLevel--;
}