You are here

public function PHPUnit_Util_Configuration::getTestSuiteConfiguration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Util/Configuration.php \PHPUnit_Util_Configuration::getTestSuiteConfiguration()

Returns the test suite configuration.

@since Method available since Release 3.2.1

Return value

PHPUnit_Framework_TestSuite

File

vendor/phpunit/phpunit/src/Util/Configuration.php, line 851

Class

PHPUnit_Util_Configuration
Wrapper for the PHPUnit XML configuration file.

Code

public function getTestSuiteConfiguration($testSuiteFilter = null) {
  $testSuiteNodes = $this->xpath
    ->query('testsuites/testsuite');
  if ($testSuiteNodes->length == 0) {
    $testSuiteNodes = $this->xpath
      ->query('testsuite');
  }
  if ($testSuiteNodes->length == 1) {
    return $this
      ->getTestSuite($testSuiteNodes
      ->item(0), $testSuiteFilter);
  }
  if ($testSuiteNodes->length > 1) {
    $suite = new PHPUnit_Framework_TestSuite();
    foreach ($testSuiteNodes as $testSuiteNode) {
      $suite
        ->addTestSuite($this
        ->getTestSuite($testSuiteNode, $testSuiteFilter));
    }
    return $suite;
  }
}