spec\Prophecy\Call\CallCenterSpec::it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall PHP Method

it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall() public method

public it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall ( $objectProphecy, Prophecy\Prophecy\MethodProphecy $method1, Prophecy\Prophecy\MethodProphecy $method2, Prophecy\Prophecy\MethodProphecy $method3, Prophecy\Argument\ArgumentsWildcard $arguments1, Prophecy\Argument\ArgumentsWildcard $arguments2, Prophecy\Argument\ArgumentsWildcard $arguments3, Prophecy\Promise\PromiseInterface $promise )
$method1 Prophecy\Prophecy\MethodProphecy
$method2 Prophecy\Prophecy\MethodProphecy
$method3 Prophecy\Prophecy\MethodProphecy
$arguments1 Prophecy\Argument\ArgumentsWildcard
$arguments2 Prophecy\Argument\ArgumentsWildcard
$arguments3 Prophecy\Argument\ArgumentsWildcard
$promise Prophecy\Promise\PromiseInterface
    function it_executes_promise_of_method_prophecy_that_matches_with_highest_score_to_makeCall($objectProphecy, MethodProphecy $method1, MethodProphecy $method2, MethodProphecy $method3, ArgumentsWildcard $arguments1, ArgumentsWildcard $arguments2, ArgumentsWildcard $arguments3, PromiseInterface $promise)
    {
        $method1->getMethodName()->willReturn('getName');
        $method1->getArgumentsWildcard()->willReturn($arguments1);
        $arguments1->scoreArguments(array('world', 'everything'))->willReturn(50);
        $method2->getMethodName()->willReturn('getName');
        $method2->getArgumentsWildcard()->willReturn($arguments2);
        $method2->getPromise()->willReturn($promise);
        $arguments2->scoreArguments(array('world', 'everything'))->willReturn(300);
        $method3->getMethodName()->willReturn('getName');
        $method3->getArgumentsWildcard()->willReturn($arguments3);
        $arguments3->scoreArguments(array('world', 'everything'))->willReturn(200);
        $objectProphecy->getMethodProphecies()->willReturn(array('method1' => array($method1), 'method2' => array($method2, $method3)));
        $objectProphecy->getMethodProphecies('getName')->willReturn(array($method1, $method2, $method3));
        $objectProphecy->reveal()->willReturn(new \stdClass());
        $promise->execute(array('world', 'everything'), $objectProphecy->getWrappedObject(), $method2)->willReturn('second');
        $this->makeCall($objectProphecy, 'getName', array('world', 'everything'))->shouldReturn('second');
    }