You are here

public function NoCallsPrediction::check in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Prediction/NoCallsPrediction.php \Prophecy\Prediction\NoCallsPrediction::check()

Tests that there were no calls made.

Parameters

Call[] $calls:

ObjectProphecy $object:

MethodProphecy $method:

Throws

\Prophecy\Exception\Prediction\UnexpectedCallsException

Overrides PredictionInterface::check

File

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

Class

NoCallsPrediction
No calls prediction.

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);
}