You are here

public function PHPUnit_Util_Configuration::getLoggingConfiguration in Zircon Profile 8

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

Returns the logging configuration.

Return value

array

File

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

Class

PHPUnit_Util_Configuration
Wrapper for the PHPUnit XML configuration file.

Code

public function getLoggingConfiguration() {
  $result = array();
  foreach ($this->xpath
    ->query('logging/log') as $log) {
    $type = (string) $log
      ->getAttribute('type');
    $target = (string) $log
      ->getAttribute('target');
    if (!$target) {
      continue;
    }
    $target = $this
      ->toAbsolutePath($target);
    if ($type == 'coverage-html') {
      if ($log
        ->hasAttribute('lowUpperBound')) {
        $result['lowUpperBound'] = $this
          ->getInteger((string) $log
          ->getAttribute('lowUpperBound'), 50);
      }
      if ($log
        ->hasAttribute('highLowerBound')) {
        $result['highLowerBound'] = $this
          ->getInteger((string) $log
          ->getAttribute('highLowerBound'), 90);
      }
    }
    elseif ($type == 'coverage-crap4j') {
      if ($log
        ->hasAttribute('threshold')) {
        $result['crap4jThreshold'] = $this
          ->getInteger((string) $log
          ->getAttribute('threshold'), 30);
      }
    }
    elseif ($type == 'junit') {
      if ($log
        ->hasAttribute('logIncompleteSkipped')) {
        $result['logIncompleteSkipped'] = $this
          ->getBoolean((string) $log
          ->getAttribute('logIncompleteSkipped'), false);
      }
    }
    elseif ($type == 'coverage-text') {
      if ($log
        ->hasAttribute('showUncoveredFiles')) {
        $result['coverageTextShowUncoveredFiles'] = $this
          ->getBoolean((string) $log
          ->getAttribute('showUncoveredFiles'), false);
      }
      if ($log
        ->hasAttribute('showOnlySummary')) {
        $result['coverageTextShowOnlySummary'] = $this
          ->getBoolean((string) $log
          ->getAttribute('showOnlySummary'), false);
      }
    }
    $result[$type] = $target;
  }
  return $result;
}