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

Breadcrumb

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

function Matcher::verify

Throws

ExpectationFailedException

MethodNameNotConfiguredException

File

vendor/phpunit/phpunit/src/Framework/MockObject/Runtime/Matcher.php, line 181

Class

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

Namespace

PHPUnit\Framework\MockObject

Code

public function verify() : void {
    if ($this->methodNameRule === null) {
        throw new MethodNameNotConfiguredException();
    }
    try {
        $this->invocationRule
            ->verify();
        if ($this->parametersRule === null) {
            $this->parametersRule = new AnyParameters();
        }
        $invocationIsAny = $this->invocationRule instanceof AnyInvokedCount;
        $invocationIsNever = $this->invocationRule instanceof InvokedCount && $this->invocationRule
            ->isNever();
        $invocationIsAtMost = $this->invocationRule instanceof InvokedAtMostCount;
        if (!$invocationIsAny && !$invocationIsNever && !$invocationIsAtMost) {
            $this->parametersRule
                ->verify();
        }
    } catch (ExpectationFailedException $e) {
        throw new ExpectationFailedException(sprintf("Expectation failed for %s when %s.\n%s", $this->methodNameRule
            ->toString(), $this->invocationRule
            ->toString(), ThrowableToStringMapper::map($e)));
    }
}
RSS feed
Powered by Drupal