forked from LiveCarta/PayPal-PHP-SDK
Renaming Namespaces and Organizing Classes
- Updated OpenId classes to be in API namespace - Updated PP Naming Convention to PayPal Naming Convention - FormatConverter Class got its own namespace - Handlers are grouped in Handler namespace - Samples and Tests Updated Accordingly
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Common\ResourceModel;
|
||||
use PayPal\Common\PayPalResourceModel;
|
||||
use PayPal\Validation\ArgumentValidator;
|
||||
use PayPal\Api\WebhookList;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Api\Webhook;
|
||||
|
||||
/**
|
||||
@@ -108,17 +108,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testCreate($obj, $mockApiContext)
|
||||
{
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall')
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPPRestCall->expects($this->any())
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->create($mockApiContext, $mockPPRestCall);
|
||||
$result = $obj->create($mockApiContext, $mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -127,17 +127,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet($obj, $mockApiContext)
|
||||
{
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall')
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPPRestCall->expects($this->any())
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
WebhookTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->get("webhookId", $mockApiContext, $mockPPRestCall);
|
||||
$result = $obj->get("webhookId", $mockApiContext, $mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -146,17 +146,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetAll($obj, $mockApiContext)
|
||||
{
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall')
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPPRestCall->expects($this->any())
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
WebhookListTest::getJson()
|
||||
));
|
||||
|
||||
$result = $obj->getAll($mockApiContext, $mockPPRestCall);
|
||||
$result = $obj->getAll($mockApiContext, $mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -165,18 +165,18 @@ class WebhookTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testUpdate($obj, $mockApiContext)
|
||||
{
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall')
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPPRestCall->expects($this->any())
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
self::getJson()
|
||||
));
|
||||
$patchRequest = PatchRequestTest::getObject();
|
||||
|
||||
$result = $obj->update($patchRequest, $mockApiContext, $mockPPRestCall);
|
||||
$result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
/**
|
||||
@@ -185,17 +185,17 @@ class WebhookTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testDelete($obj, $mockApiContext)
|
||||
{
|
||||
$mockPPRestCall = $this->getMockBuilder('\PayPal\Transport\PPRestCall')
|
||||
$mockPayPalRestCall = $this->getMockBuilder('\PayPal\Transport\PayPalRestCall')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$mockPPRestCall->expects($this->any())
|
||||
$mockPayPalRestCall->expects($this->any())
|
||||
->method('execute')
|
||||
->will($this->returnValue(
|
||||
true
|
||||
));
|
||||
|
||||
$result = $obj->delete($mockApiContext, $mockPPRestCall);
|
||||
$result = $obj->delete($mockApiContext, $mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user