Updated version of SDK Core

- Fixed Tests
- Fixed Samples
This commit is contained in:
japatel
2014-09-26 12:01:40 -05:00
parent 72ddeccc0a
commit 5f47b3fb11
3 changed files with 4 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ require __DIR__ . '/common.php';
use PayPal\Rest\ApiContext;
use PayPal\Auth\OAuthTokenCredential;
/** @var \Paypal\Rest\ApiContext $apiContext */
$apiContext = getApiContext();

View File

@@ -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);

View File

@@ -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()));
}
}