forked from LiveCarta/PayPal-PHP-SDK
Enabled EC Parameters support
- Updated Api to enabled EC Parameters - Updated Tests - Updated Logging Manager - Added a feature to do validation on accessors.
This commit is contained in:
@@ -4,35 +4,40 @@ namespace PayPal\Test\Api;
|
||||
use PayPal\Api\CreditCardToken;
|
||||
use PayPal\Test\Constants;
|
||||
|
||||
class CreditCardTokenTest extends \PHPUnit_Framework_TestCase {
|
||||
class CreditCardTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
private $ccToken;
|
||||
private $ccToken;
|
||||
|
||||
public static $payerId = "PAYER-123";
|
||||
public static $creditCardId = "CC-123";
|
||||
public static $payerId = "PAYER-123";
|
||||
public static $creditCardId = "CC-123";
|
||||
|
||||
public static function createCreditCardToken() {
|
||||
$ccToken = new CreditCardToken();
|
||||
$ccToken->setPayerId(self::$payerId);
|
||||
$ccToken->setCreditCardId(self::$creditCardId);
|
||||
return $ccToken;
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
$this->ccToken = self::createCreditCardToken();
|
||||
}
|
||||
public static function createCreditCardToken()
|
||||
{
|
||||
$ccToken = new CreditCardToken();
|
||||
$ccToken->setPayerId(self::$payerId);
|
||||
$ccToken->setCreditCardId(self::$creditCardId);
|
||||
return $ccToken;
|
||||
}
|
||||
|
||||
public function testGetterSetter() {
|
||||
$this->assertEquals(self::$payerId, $this->ccToken->getPayerId());
|
||||
$this->assertEquals(self::$creditCardId, $this->ccToken->getCreditCardId());
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$t1 = $this->ccToken;
|
||||
|
||||
$t2 = new CreditCardToken();
|
||||
$t2->fromJson($t1->toJson());
|
||||
|
||||
$this->assertEquals($t1, $t2);
|
||||
}
|
||||
public function setup()
|
||||
{
|
||||
$this->ccToken = self::createCreditCardToken();
|
||||
}
|
||||
|
||||
public function testGetterSetter()
|
||||
{
|
||||
$this->assertEquals(self::$payerId, $this->ccToken->getPayerId());
|
||||
$this->assertEquals(self::$creditCardId, $this->ccToken->getCreditCardId());
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize()
|
||||
{
|
||||
$t1 = $this->ccToken;
|
||||
|
||||
$t2 = new CreditCardToken();
|
||||
$t2->fromJson($t1->toJson());
|
||||
|
||||
$this->assertEquals($t1, $t2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user