public function PHP_CodeCoverage::append

Appends code coverage data.

Parameters

array $data:

mixed $id:

boolean $append:

2 calls to PHP_CodeCoverage::append()
PHP_CodeCoverage::addUncoveredFilesFromWhitelist in drupal/core/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php
Processes whitelisted files that are not covered.
PHP_CodeCoverage::stop in drupal/core/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php
Stop collection of code coverage information.

File

drupal/core/vendor/phpunit/php-code-coverage/PHP/CodeCoverage.php, line 267

Class

PHP_CodeCoverage
Provides collection functionality for PHP code coverage information.

Code

public function append(array $data, $id = NULL, $append = TRUE) {
  if ($id === NULL) {
    $id = $this->currentId;
  }
  if ($id === NULL) {
    throw new PHP_CodeCoverage_Exception();
  }
  $this
    ->applyListsFilter($data);
  $this
    ->initializeFilesThatAreSeenTheFirstTime($data);
  if (!$append) {
    return;
  }
  if ($id != 'UNCOVERED_FILES_FROM_WHITELIST') {
    $this
      ->applyCoversAnnotationFilter($data, $id);
  }
  if (empty($data)) {
    return;
  }
  $status = NULL;
  if ($id instanceof PHPUnit_Framework_TestCase) {
    $status = $id
      ->getStatus();
    $id = get_class($id) . '::' . $id
      ->getName();
  }
  else {
    if ($id instanceof PHPUnit_Extensions_PhptTestCase) {
      $id = $id
        ->getName();
    }
  }
  $this->tests[$id] = $status;
  foreach ($data as $file => $lines) {
    if (!$this->filter
      ->isFile($file)) {
      continue;
    }
    foreach ($lines as $k => $v) {
      if ($v == 1) {
        $this->data[$file][$k][] = $id;
      }
    }
  }
}