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:
@@ -6,13 +6,13 @@ use PayPal\Api\Patch;
|
||||
use PayPal\Api\PatchRequest;
|
||||
use PayPal\Api\Plan;
|
||||
use PayPal\Auth\OAuthTokenCredential;
|
||||
use PayPal\Common\PPModel;
|
||||
use PayPal\Core\PPCredentialManager;
|
||||
use PayPal\Common\PayPalModel;
|
||||
use PayPal\Core\PayPalCredentialManager;
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Rest\IResource;
|
||||
use PayPal\Api\CreateProfileResponse;
|
||||
use PayPal\Test\Functional\Setup;
|
||||
use PayPal\Transport\PPRestCall;
|
||||
use PayPal\Transport\PayPalRestCall;
|
||||
use PayPal\Api\WebProfile;
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public $mode = 'mock';
|
||||
|
||||
public $mockPPRestCall;
|
||||
public $mockPayPalRestCall;
|
||||
|
||||
public $context;
|
||||
|
||||
@@ -86,7 +86,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$obj = new Plan($request);
|
||||
$result = $obj->create(null, $this->mockPPRestCall);
|
||||
$result = $obj->create(null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
self::$obj = $result;
|
||||
return $result;
|
||||
@@ -96,7 +96,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$request = $this->operation['request']['body'];
|
||||
$obj = new Plan($request);
|
||||
$result = $obj->create(null, $this->mockPPRestCall);
|
||||
$result = $obj->create(null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
return $result;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGet($plan)
|
||||
{
|
||||
$result = Plan::get($plan->getId(), null, $this->mockPPRestCall);
|
||||
$result = Plan::get($plan->getId(), null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$this->assertEquals($plan->getId(), $result->getId());
|
||||
$this->assertEquals($plan, $result, "", 0, 10, true);
|
||||
@@ -121,7 +121,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testGetList($plan)
|
||||
{
|
||||
$result = Plan::all(array('page_size' => '20', 'total_required' => 'yes'), null, $this->mockPPRestCall);
|
||||
$result = Plan::all(array('page_size' => '20', 'total_required' => 'yes'), null, $this->mockPayPalRestCall);
|
||||
$this->assertNotNull($result);
|
||||
$totalPages = $result->getTotalPages();
|
||||
$found = false;
|
||||
@@ -135,7 +135,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$result = Plan::all(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPPRestCall);
|
||||
$result = Plan::all(array('page' => --$totalPages, 'page_size' => '20', 'total_required' => 'yes'), null, $this->mockPayPalRestCall);
|
||||
|
||||
}
|
||||
} while ($totalPages > 0 && $found == false);
|
||||
@@ -160,7 +160,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$patches[] = $patch;
|
||||
$patchRequest = new PatchRequest();
|
||||
$patchRequest->setPatches($patches);
|
||||
$result = $plan->update($patchRequest, null, $this->mockPPRestCall);
|
||||
$result = $plan->update($patchRequest, null, $this->mockPayPalRestCall);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$patches[] = $patch;
|
||||
$patchRequest = new PatchRequest();
|
||||
$patchRequest->setPatches($patches);
|
||||
$result = $plan->update($patchRequest, null, $this->mockPPRestCall);
|
||||
$result = $plan->update($patchRequest, null, $this->mockPayPalRestCall);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
|
||||
@@ -202,8 +202,8 @@ class BillingPlansFunctionalTest extends \PHPUnit_Framework_TestCase
|
||||
$patches[] = $patch;
|
||||
$patchRequest = new PatchRequest();
|
||||
$patchRequest->setPatches($patches);
|
||||
$result = $plan->update($patchRequest, null, $this->mockPPRestCall);
|
||||
$result = $plan->update($patchRequest, null, $this->mockPayPalRestCall);
|
||||
$this->assertTrue($result);
|
||||
return Plan::get($plan->getId(), null, $this->mockPPRestCall);
|
||||
return Plan::get($plan->getId(), null, $this->mockPayPalRestCall);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user