You are here

private function CallCenter::createUnexpectedCallException in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php \Prophecy\Call\CallCenter::createUnexpectedCallException()
1 call to CallCenter::createUnexpectedCallException()
CallCenter::makeCall in vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php
Makes and records specific method call for object prophecy.

File

vendor/phpspec/prophecy/src/Prophecy/Call/CallCenter.php, line 129

Class

CallCenter
Calls receiver & manager.

Namespace

Prophecy\Call

Code

private function createUnexpectedCallException(ObjectProphecy $prophecy, $methodName, array $arguments) {
  $classname = get_class($prophecy
    ->reveal());
  $argstring = implode(', ', array_map(array(
    $this->util,
    'stringify',
  ), $arguments));
  $expected = implode("\n", array_map(function (MethodProphecy $methodProphecy) {
    return sprintf('  - %s(%s)', $methodProphecy
      ->getMethodName(), $methodProphecy
      ->getArgumentsWildcard());
  }, call_user_func_array('array_merge', $prophecy
    ->getMethodProphecies())));
  return new UnexpectedCallException(sprintf("Method call:\n" . "  - %s(%s)\n" . "on %s was not expected, expected calls were:\n%s", $methodName, $argstring, $classname, $expected), $prophecy, $methodName, $arguments);
}