public function 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

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

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());
      $packageInformation = PHPUnit_Util_Class::getPackageInformation($suite
        ->getName(), $class
        ->getDocComment());
      if (!empty($packageInformation['namespace'])) {
        $testSuite
          ->setAttribute('namespace', $packageInformation['namespace']);
      }
      if (!empty($packageInformation['fullPackage'])) {
        $testSuite
          ->setAttribute('fullPackage', $packageInformation['fullPackage']);
      }
      if (!empty($packageInformation['category'])) {
        $testSuite
          ->setAttribute('category', $packageInformation['category']);
      }
      if (!empty($packageInformation['package'])) {
        $testSuite
          ->setAttribute('package', $packageInformation['package']);
      }
      if (!empty($packageInformation['subpackage'])) {
        $testSuite
          ->setAttribute('subpackage', $packageInformation['subpackage']);
      }
    } 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;
}