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

Breadcrumb

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

function File::numberOfTestedMethods

Overrides AbstractNode::numberOfTestedMethods

File

vendor/phpunit/php-code-coverage/src/Node/File.php, line 305

Class

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

Namespace

SebastianBergmann\CodeCoverage\Node

Code

public function numberOfTestedMethods() : int {
    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;
}

API Navigation

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