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

Breadcrumb

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

function NoCallsPrediction::check

Overrides PredictionInterface::check

File

vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php, line 34

Class

NoCallsPrediction
Tests that there were no calls made.

Namespace

Prophecy\Prediction

Code

public function check(array $calls, ObjectProphecy $object, MethodProphecy $method) {
    if (!count($calls)) {
        return;
    }
    $verb = count($calls) === 1 ? 'was' : 'were';
    throw new UnexpectedCallsException(sprintf("No calls expected that match:\n" . "  %s->%s(%s)\n" . "but %d %s made:\n%s", get_class($object->reveal()), $method->getMethodName(), $method->getArgumentsWildcard(), count($calls), $verb, $this->util
        ->stringifyCalls($calls)), $method, $calls);
}
RSS feed
Powered by Drupal