You are here

public function PHP_CodeCoverage_Report_Node_File::getNumTestedMethods in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/File.php \PHP_CodeCoverage_Report_Node_File::getNumTestedMethods()

Returns the number of tested methods.

Return value

int

Overrides PHP_CodeCoverage_Report_Node::getNumTestedMethods

File

vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/File.php, line 291

Class

PHP_CodeCoverage_Report_Node_File
Represents a file in the code coverage information tree.

Code

public function getNumTestedMethods() {
  if ($this->numTestedMethods === null) {
    $this->numTestedMethods = 0;
    foreach ($this->classes as $class) {
      foreach ($class['methods'] as $method) {
        if ($method['executableLines'] > 0 && $method['coverage'] == 100) {
          $this->numTestedMethods++;
        }
      }
    }
    foreach ($this->traits as $trait) {
      foreach ($trait['methods'] as $method) {
        if ($method['executableLines'] > 0 && $method['coverage'] == 100) {
          $this->numTestedMethods++;
        }
      }
    }
  }
  return $this->numTestedMethods;
}