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

Breadcrumb

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

function ObjectProphecy::__call

Creates new method prophecy using specified method name and arguments.

Parameters

string $methodName:

array<mixed> $arguments:

Return value

MethodProphecy

File

vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php, line 249

Class

ObjectProphecy
@author Konstantin Kudryashov <ever.zet@gmail.com>

Namespace

Prophecy\Prophecy

Code

public function __call($methodName, array $arguments) {
    $arguments = $this->revealer
        ->reveal($arguments);
    \assert(\is_array($arguments));
    $arguments = new ArgumentsWildcard($arguments);
    foreach ($this->getMethodProphecies($methodName) as $prophecy) {
        $argumentsWildcard = $prophecy->getArgumentsWildcard();
        $comparator = $this->comparatorFactory
            ->getComparatorFor($argumentsWildcard, $arguments);
        try {
            $comparator->assertEquals($argumentsWildcard, $arguments);
            return $prophecy;
        } catch (ComparisonFailure $failure) {
        }
    }
    return new MethodProphecy($this, $methodName, $arguments);
}
RSS feed
Powered by Drupal