Updated stubs to support namespace

This commit is contained in:
Ganesh Hegde
2013-05-29 14:37:22 +05:30
parent 479730d1c4
commit 50d2c56f8b
37 changed files with 530 additions and 324 deletions

View File

@@ -4,12 +4,13 @@
use PayPal\Auth\OAuthTokenCredential;
use PayPal\Test\Constants;
use PayPal\Core\PPConfigManager;
use PayPal\Exception\PPConnectionException;
class OAuthTokenCredentialTest extends PHPUnit_Framework_TestCase {
public function testGetAccessToken() {
$cred = new OAuthTokenCredential(Constants::CLIENT_ID, Constants::CLIENT_SECRET);
$config = \PPConfigManager::getInstance()->getConfigHashmap();
$config = PPConfigManager::getInstance()->getConfigHashmap();
$token = $cred->getAccessToken($config);
$this->assertNotNull($token);
@@ -27,8 +28,8 @@ class OAuthTokenCredentialTest extends PHPUnit_Framework_TestCase {
}
public function testInvalidCredentials() {
$this->setExpectedException('\PPConnectionException');
$this->setExpectedException('PayPal\Exception\PPConnectionException');
$cred = new OAuthTokenCredential('dummy', 'secret');
$this->assertNull($cred->getAccessToken(\PPConfigManager::getInstance()->getConfigHashmap()));
$this->assertNull($cred->getAccessToken(PPConfigManager::getInstance()->getConfigHashmap()));
}
}