PHPSpec2\Mocker\MockeryMocker::withArguments PHP Method

withArguments() public method

public withArguments ( $expectation, array $arguments = null )
$arguments array
    public function withArguments($expectation, array $arguments = null)
    {
        if (null === $arguments) {
            return;
        }
        if (0 == count($arguments)) {
            $expectation->withNoArgs();
            return;
        }
        if (is_string($arguments[0]) && ANY_ARGUMENTS === $arguments[0]) {
            $expectation->withAnyArgs();
            return;
        }
        $arguments = array_map(function ($arg) {
            if (is_string($arg) && ANY_ARGUMENT === $arg) {
                return Mockery::any();
            } else {
                return $arg;
            }
        }, $arguments);
        call_user_func_array(array($expectation, 'with'), $arguments);
    }