Payum\Paypal\ProHosted\Nvp\Tests\Action\Api\GetTransactionDetailsActionTest::shouldCallApiGetTransactionDetailsAndUpdateModelFromResponseOnSuccess PHP Method

shouldCallApiGetTransactionDetailsAndUpdateModelFromResponseOnSuccess() public method

    public function shouldCallApiGetTransactionDetailsAndUpdateModelFromResponseOnSuccess()
    {
        $apiMock = $this->createApiMock();
        $apiMock->expects($this->once())->method('getTransactionDetails')->will($this->returnCallback(function () {
            return array('PAYMENTSTATUS' => 'theStatus');
        }));
        $action = new GetTransactionDetailsAction();
        $action->setApi($apiMock);
        $request = new GetTransactionDetails(array('txn_id' => 'aTransactionId'));
        $action->execute($request);
        $model = $request->getModel();
        $this->assertArrayHasKey('PAYMENTSTATUS', $model);
        $this->assertEquals('theStatus', $model['PAYMENTSTATUS']);
    }