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:
@@ -23,7 +23,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public $response;
|
||||
|
||||
public $mockPPRestCall;
|
||||
public $mockPayPalRestCall;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
@@ -58,7 +58,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$obj = new Invoice($request);
|
||||
$result = $obj->create(null, $this->mockPPRestCall);
|
||||
$result = $obj->create(null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
self::$obj = $result;
|
||||
return $result;
|
||||
@@ -71,7 +71,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet($invoice)
|
||||
{
|
||||
$result = Invoice::get($invoice->getId(), null, $this->mockPPRestCall);
|
||||
$result = Invoice::get($invoice->getId(), null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals($invoice->getId(), $result->getId());
|
||||
return $result;
|
||||
@@ -84,7 +84,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testSend($invoice)
|
||||
{
|
||||
$result = $invoice->send(null, $this->mockPPRestCall);
|
||||
$result = $invoice->send(null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
return $invoice;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
public function testUpdate($invoice)
|
||||
{
|
||||
$this->markTestSkipped('Skipped as the fix is on the way. #PPTIPS-1932');
|
||||
$result = $invoice->update(null, $this->mockPPRestCall);
|
||||
$result = $invoice->update(null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals($invoice->getId(), $result->getId());
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetAll($invoice)
|
||||
{
|
||||
$result = Invoice::getAll(array('page_size' => '20', 'total_count_required' => 'true'), null, $this->mockPPRestCall);
|
||||
$result = Invoice::getAll(array('page_size' => '20', 'total_count_required' => 'true'), null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertNotNull($result->getTotalCount());
|
||||
$totalPages = ceil($result->getTotalCount()/20);
|
||||
@@ -124,7 +124,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$result = Invoice::getAll(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPPRestCall);
|
||||
$result = Invoice::getAll(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPayPalRestCall);
|
||||
|
||||
}
|
||||
} while ($totalPages > 0 && $found == false);
|
||||
@@ -141,7 +141,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$search = new Search($request);
|
||||
$result = Invoice::search($search, null, $this->mockPPRestCall);
|
||||
$result = Invoice::search($search, null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertNotNull($result->getTotalCount());
|
||||
}
|
||||
@@ -155,7 +155,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$notification = new Notification($request);
|
||||
$result = $invoice->remind($notification, null, $this->mockPPRestCall);
|
||||
$result = $invoice->remind($notification, null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$notification = new CancelNotification($request);
|
||||
$result = $invoice->cancel($notification, null, $this->mockPPRestCall);
|
||||
$result = $invoice->cancel($notification, null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testQRCode($invoice)
|
||||
{
|
||||
$result = Invoice::qrCode($invoice->getId(), array(), null, $this->mockPPRestCall);
|
||||
$result = Invoice::qrCode($invoice->getId(), array(), null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertNotNull($result->getImage());
|
||||
}
|
||||
@@ -198,7 +198,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$this->setupTest($this->getClassName(), 'testRecordPayment');
|
||||
$request = $this->operation['request']['body'];
|
||||
$paymentDetail = new PaymentDetail($request);
|
||||
$result = $invoice->recordPayment($paymentDetail, null, $this->mockPPRestCall);
|
||||
$result = $invoice->recordPayment($paymentDetail, null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
return $invoice;
|
||||
}
|
||||
@@ -213,7 +213,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$refundDetail = new RefundDetail($request);
|
||||
$result = $invoice->recordRefund($refundDetail, null, $this->mockPPRestCall);
|
||||
$result = $invoice->recordRefund($refundDetail, null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->setupTest($this->getClassName(), 'testDelete');
|
||||
$invoice = $this->testDelete($invoice);
|
||||
@@ -230,7 +230,7 @@ class InvoiceFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$this->setupTest($this->getClassName(), 'testCreate');
|
||||
$invoice = $this->testCreate($invoice);
|
||||
$this->setupTest($this->getClassName(), 'testDelete');
|
||||
$result = $invoice->delete(null, $this->mockPPRestCall);
|
||||
$result = $invoice->delete(null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user