forked from LiveCarta/PayPal-PHP-SDK
Update Payment Experience API to v1.3
This commit is contained in:
@@ -17,7 +17,7 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"id":"TestSample","name":"TestSample","flow_config":' .FlowConfigTest::getJson() . ',"input_fields":' .InputFieldsTest::getJson() . ',"presentation":' .PresentationTest::getJson() . '}';
|
||||
return '{"id":"TestSample","name":"TestSample","temporary":true,"flow_config":' .FlowConfigTest::getJson() . ',"input_fields":' .InputFieldsTest::getJson() . ',"presentation":' .PresentationTest::getJson() . '}';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,6 +40,7 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj);
|
||||
$this->assertNotNull($obj->getId());
|
||||
$this->assertNotNull($obj->getName());
|
||||
$this->assertNotNull($obj->getTemporary());
|
||||
$this->assertNotNull($obj->getFlowConfig());
|
||||
$this->assertNotNull($obj->getInputFields());
|
||||
$this->assertNotNull($obj->getPresentation());
|
||||
@@ -55,6 +56,7 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->assertEquals($obj->getId(), "TestSample");
|
||||
$this->assertEquals($obj->getName(), "TestSample");
|
||||
$this->assertEquals($obj->getTemporary(), true);
|
||||
$this->assertEquals($obj->getFlowConfig(), FlowConfigTest::getObject());
|
||||
$this->assertEquals($obj->getInputFields(), InputFieldsTest::getObject());
|
||||
$this->assertEquals($obj->getPresentation(), PresentationTest::getObject());
|
||||
@@ -66,17 +68,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCreate($obj, $mockApiContext)
|
||||
{
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
CreateProfileResponseTest::getJson()
|
||||
self::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->create($mockApiContext, $mockPayPalRestCall);
|
||||
$result = $obj->create($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -85,17 +87,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testUpdate($obj, $mockApiContext)
|
||||
{
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
true
|
||||
));
|
||||
|
||||
$result = $obj->update($mockApiContext, $mockPayPalRestCall);
|
||||
$result = $obj->update($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -104,18 +106,18 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testPartialUpdate($obj, $mockApiContext)
|
||||
{
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
true
|
||||
));
|
||||
$patch = array(PatchTest::getObject());
|
||||
|
||||
$result = $obj->partial_update($patch, $mockApiContext, $mockPayPalRestCall);
|
||||
$result = $obj->partial_update($patch, $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -124,17 +126,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet($obj, $mockApiContext)
|
||||
{
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
WebProfileTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("profileId", $mockApiContext, $mockPayPalRestCall);
|
||||
$result = $obj->get("profileId", $mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -143,17 +145,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetList($obj, $mockApiContext)
|
||||
{
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
json_encode(array(json_decode(WebProfileTest::getJson())))
|
||||
));
|
||||
|
||||
$result = $obj->get_list($mockApiContext, $mockPayPalRestCall);
|
||||
$result = $obj->get_list($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -162,17 +164,17 @@ class WebProfileTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testDelete($obj, $mockApiContext)
|
||||
{
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
$mockPPRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
true
|
||||
));
|
||||
|
||||
$result = $obj->delete($mockApiContext, $mockPayPalRestCall);
|
||||
$result = $obj->delete($mockApiContext, $mockPPRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user