Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ProcessedCodeCoverageData.php

function ProcessedCodeCoverageData::markCodeAsExecutedByTestCase

File

vendor/phpunit/php-code-coverage/src/Data/ProcessedCodeCoverageData.php, line 85

Class

ProcessedCodeCoverageData
@internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage

Namespace

SebastianBergmann\CodeCoverage\Data

Code

public function markCodeAsExecutedByTestCase(string $testCaseId, RawCodeCoverageData $executedCode) : void {
    foreach ($executedCode->lineCoverage() as $file => $lines) {
        foreach ($lines as $k => $v) {
            if ($v === Driver::LINE_EXECUTED) {
                $this->lineCoverage[$file][$k][] = $testCaseId;
            }
        }
    }
    foreach ($executedCode->functionCoverage() as $file => $functions) {
        foreach ($functions as $functionName => $functionData) {
            foreach ($functionData['branches'] as $branchId => $branchData) {
                if ($branchData['hit'] === Driver::BRANCH_HIT) {
                    $this->functionCoverage[$file][$functionName]['branches'][$branchId]['hit'][] = $testCaseId;
                }
            }
            foreach ($functionData['paths'] as $pathId => $pathData) {
                if ($pathData['hit'] === Driver::BRANCH_HIT) {
                    $this->functionCoverage[$file][$functionName]['paths'][$pathId]['hit'][] = $testCaseId;
                }
            }
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal