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

Breadcrumb

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

class MockMethodSet

@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

@internal This class is not covered by the backward compatibility promise for PHPUnit

Hierarchy

  • class \PHPUnit\Framework\MockObject\Generator\MockMethodSet

Expanded class hierarchy of MockMethodSet

File

vendor/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethodSet.php, line 21

Namespace

PHPUnit\Framework\MockObject\Generator
View source
final class MockMethodSet {
    
    /**
     * @psalm-var array<string,MockMethod>
     */
    private array $methods = [];
    public function addMethods(MockMethod ...$methods) : void {
        foreach ($methods as $method) {
            $this->methods[strtolower($method->methodName())] = $method;
        }
    }
    
    /**
     * @psalm-return list<MockMethod>
     */
    public function asArray() : array {
        return array_values($this->methods);
    }
    public function hasMethod(string $methodName) : bool {
        return array_key_exists(strtolower($methodName), $this->methods);
    }

}

Members

Title Sort descending Modifiers Object type Summary
MockMethodSet::$methods private property @psalm-var array&lt;string,MockMethod&gt;
MockMethodSet::addMethods public function
MockMethodSet::asArray public function @psalm-return list&lt;MockMethod&gt;
MockMethodSet::hasMethod public function

API Navigation

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