forked from LiveCarta/PayPal-PHP-SDK
Updated version of SDK Core
- Fixed Tests - Fixed Samples
This commit is contained in:
@@ -23,6 +23,7 @@ require __DIR__ . '/common.php';
|
||||
use PayPal\Rest\ApiContext;
|
||||
use PayPal\Auth\OAuthTokenCredential;
|
||||
|
||||
/** @var \Paypal\Rest\ApiContext $apiContext */
|
||||
$apiContext = getApiContext();
|
||||
|
||||
|
||||
|
||||
@@ -60,10 +60,6 @@ class CreditCardHistoryTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
|
||||
public function testSerializationDeserialization() {
|
||||
// Stop here and mark this test as incomplete.
|
||||
$this->markTestIncomplete(
|
||||
'This test is failing because of warning thrown by regex at https://github.com/paypal/sdk-core-php/blob/master/lib/common/PPReflectionUtil.php#L59.'
|
||||
);
|
||||
$cardHistory = new CreditCardHistory();
|
||||
$cardHistory->setCreditCards(array($this->cards['partial'], $this->cards['full']));
|
||||
$cardHistory->setCount(2);
|
||||
|
||||
@@ -10,9 +10,8 @@ class OAuthTokenCredentialTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
public function testGetAccessToken() {
|
||||
$cred = new OAuthTokenCredential(Constants::CLIENT_ID, Constants::CLIENT_SECRET);
|
||||
$config = PPConfigManager::getInstance()->getConfigHashmap();
|
||||
|
||||
$token = $cred->getAccessToken($config);
|
||||
$config = PPConfigManager::getConfigWithDefaults();
|
||||
$token = $cred->getAccessToken($config);
|
||||
$this->assertNotNull($token);
|
||||
|
||||
// Check that we get the same token when issuing a new call before token expiry
|
||||
@@ -30,6 +29,6 @@ class OAuthTokenCredentialTest extends PHPUnit_Framework_TestCase {
|
||||
public function testInvalidCredentials() {
|
||||
$this->setExpectedException('PayPal\Exception\PPConnectionException');
|
||||
$cred = new OAuthTokenCredential('dummy', 'secret');
|
||||
$this->assertNull($cred->getAccessToken(PPConfigManager::getInstance()->getConfigHashmap()));
|
||||
$this->assertNull($cred->getAccessToken(PPConfigManager::getConfigWithDefaults()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user