Payum\Paypal\ProHosted\Nvp\Tests\Action\Api\ConvertPaymentActionTest::shouldNotOverwriteAlreadySetExtraDetails PHP Method

shouldNotOverwriteAlreadySetExtraDetails() public method

    public function shouldNotOverwriteAlreadySetExtraDetails()
    {
        $gatewayMock = $this->getMock('Payum\\Core\\GatewayInterface');
        $gatewayMock->expects($this->once())->method('execute')->with($this->isInstanceOf('Payum\\Core\\Request\\GetCurrency'))->willReturnCallback(function (GetCurrency $request) {
            $request->name = 'US Dollar';
            $request->alpha3 = 'USD';
            $request->numeric = 123;
            $request->exp = 2;
            $request->country = 'US';
        });
        $payment = new Payment();
        $payment->setCurrencyCode('USD');
        $payment->setTotalAmount(123);
        $payment->setDescription('the description');
        $payment->setDetails(array('foo' => 'fooVal'));
        $action = new ConvertPaymentAction();
        $action->setGateway($gatewayMock);
        $action->execute($convert = new Convert($payment, 'array'));
        $details = $convert->getResult();
        $this->assertNotEmpty($details);
        $this->assertArrayHasKey('foo', $details);
        $this->assertEquals('fooVal', $details['foo']);
    }