Update payments API to v1.9

This commit is contained in:
mrak and sdcoffey
2016-10-25 17:29:48 -05:00
committed by jaypatel512 and sdcoffey
parent 7c5ea8b997
commit c2947ff409
92 changed files with 1583 additions and 973 deletions

View File

@@ -2,7 +2,6 @@
namespace PayPal\Test\Api;
use PayPal\Api\object;
use PayPal\Api\Payment;
/**
@@ -14,7 +13,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Payment
*
* @return string
*/
public static function getJson()
@@ -24,7 +22,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
/**
* Gets Object Instance with Json data filled in
*
* @return Payment
*/
public static function getObject()
@@ -35,7 +32,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
/**
* Tests for Serialization and Deserialization Issues
*
* @return Payment
*/
public function testSerializationDeserialization()
@@ -105,13 +101,12 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
self::getJson()
self::getJson()
));
$result = $obj->create($mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -125,13 +120,12 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
PaymentTest::getJson()
PaymentTest::getJson()
));
$result = $obj->get("paymentId", $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -152,7 +146,6 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -166,14 +159,13 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
self::getJson()
self::getJson()
));
$paymentExecution = PaymentExecutionTest::getObject();
$result = $obj->execute($paymentExecution, $mockApiContext, $mockPPRestCall);
$this->assertNotNull($result);
}
/**
* @dataProvider mockProvider
* @param Payment $obj
@@ -187,7 +179,7 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
$mockPPRestCall->expects($this->any())
->method('execute')
->will($this->returnValue(
PaymentHistoryTest::getJson()
PaymentHistoryTest::getJson()
));
$params = array();
@@ -199,8 +191,8 @@ class PaymentTest extends \PHPUnit_Framework_TestCase
{
$obj = self::getObject();
$mockApiContext = $this->getMockBuilder('ApiContext')
->disableOriginalConstructor()
->getMock();
->disableOriginalConstructor()
->getMock();
return array(
array($obj, $mockApiContext),
array($obj, null)