diff --git a/sample/bootstrap.php b/sample/bootstrap.php index d253e9c..8352f53 100644 --- a/sample/bootstrap.php +++ b/sample/bootstrap.php @@ -23,6 +23,7 @@ require __DIR__ . '/common.php'; use PayPal\Rest\ApiContext; use PayPal\Auth\OAuthTokenCredential; +/** @var \Paypal\Rest\ApiContext $apiContext */ $apiContext = getApiContext(); diff --git a/tests/PayPal/Test/Api/CreditCardHistoryTest.php b/tests/PayPal/Test/Api/CreditCardHistoryTest.php index 68702a7..a7f1b53 100644 --- a/tests/PayPal/Test/Api/CreditCardHistoryTest.php +++ b/tests/PayPal/Test/Api/CreditCardHistoryTest.php @@ -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); diff --git a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php index 5dfe13e..80589ec 100644 --- a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php +++ b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php @@ -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())); } } \ No newline at end of file