You are here

public function PHPUnit_Util_Log_JUnit::startTestSuite in Zircon Profile 8

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

A testsuite started.

@since Method available since Release 2.2.0

Parameters

PHPUnit_Framework_TestSuite $suite:

Overrides PHPUnit_Framework_TestListener::startTestSuite

File

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

Class

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

Code

public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
  $testSuite = $this->document
    ->createElement('testsuite');
  $testSuite
    ->setAttribute('name', $suite
    ->getName());
  if (class_exists($suite
    ->getName(), false)) {
    try {
      $class = new ReflectionClass($suite
        ->getName());
      $testSuite
        ->setAttribute('file', $class
        ->getFileName());
    } catch (ReflectionException $e) {
    }
  }
  if ($this->testSuiteLevel > 0) {
    $this->testSuites[$this->testSuiteLevel]
      ->appendChild($testSuite);
  }
  else {
    $this->root
      ->appendChild($testSuite);
  }
  $this->testSuiteLevel++;
  $this->testSuites[$this->testSuiteLevel] = $testSuite;
  $this->testSuiteTests[$this->testSuiteLevel] = 0;
  $this->testSuiteAssertions[$this->testSuiteLevel] = 0;
  $this->testSuiteErrors[$this->testSuiteLevel] = 0;
  $this->testSuiteFailures[$this->testSuiteLevel] = 0;
  $this->testSuiteTimes[$this->testSuiteLevel] = 0;
}