Payum\Paypal\Ipn\Tests\ApiTest::shouldProxyWholeNotificationToClientSend PHP Method

shouldProxyWholeNotificationToClientSend() public method

    public function shouldProxyWholeNotificationToClientSend()
    {
        /** @var RequestInterface $actualRequest */
        $actualRequest = null;
        $clientMock = $this->createHttpClientMock();
        $clientMock->expects($this->once())->method('send')->will($this->returnCallback(function (RequestInterface $request) use(&$actualRequest) {
            $actualRequest = $request;
            return new Response(200);
        }));
        $api = new Api(array('sandbox' => false), $clientMock, $this->createHttpMessageFactory());
        $expectedNotification = array('foo' => 'foo', 'bar' => 'baz');
        $api->notifyValidate($expectedNotification);
        $content = array();
        parse_str($actualRequest->getBody()->getContents(), $content);
        $this->assertInstanceOf('Psr\\Http\\Message\\RequestInterface', $actualRequest);
        $this->assertEquals(array('cmd' => Api::CMD_NOTIFY_VALIDATE) + $expectedNotification, $content);
        $this->assertEquals($api->getIpnEndpoint(), $actualRequest->getUri());
        $this->assertEquals('POST', $actualRequest->getMethod());
    }