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:
@@ -5,35 +5,42 @@ namespace PayPal\Test\Api;
|
||||
use PayPal\Api\PaymentHistory;
|
||||
use PayPal\Test\Constants;
|
||||
|
||||
class PaymentHistoryTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
private $history;
|
||||
|
||||
public static $count = "10";
|
||||
public static $nextId = "11";
|
||||
|
||||
public static function createPaymentHistory() {
|
||||
$history = new PaymentHistory();
|
||||
$history->setCount(self::$count);
|
||||
$history->setNextId(self::$nextId);
|
||||
$history->setPayments(array(PaymentTest::createPayment()));
|
||||
return $history;
|
||||
}
|
||||
public function setup() {
|
||||
$this->history = PaymentHistoryTest::createPaymentHistory();
|
||||
}
|
||||
|
||||
public function testGetterSetters() {
|
||||
$this->assertEquals(self::$count, $this->history->getCount());
|
||||
$this->assertEquals(self::$nextId, $this->history->getNextId());
|
||||
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$history = new PaymentHistory();
|
||||
$history->fromJson($this->history->toJSON());
|
||||
|
||||
$this->assertEquals($history, $this->history);
|
||||
}
|
||||
|
||||
class PaymentHistoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/** @var PaymentHistory */
|
||||
private $history;
|
||||
|
||||
public static $count = 10;
|
||||
public static $nextId = "11";
|
||||
|
||||
public static function createPaymentHistory()
|
||||
{
|
||||
$history = new PaymentHistory();
|
||||
$history->setCount(self::$count);
|
||||
$history->setNextId(self::$nextId);
|
||||
$history->setPayments(array(PaymentTest::createPayment()));
|
||||
return $history;
|
||||
}
|
||||
|
||||
public function setup()
|
||||
{
|
||||
$this->history = PaymentHistoryTest::createPaymentHistory();
|
||||
}
|
||||
|
||||
public function testGetterSetters()
|
||||
{
|
||||
$this->assertEquals(self::$count, $this->history->getCount());
|
||||
$this->assertEquals(self::$nextId, $this->history->getNextId());
|
||||
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize()
|
||||
{
|
||||
$history = new PaymentHistory();
|
||||
$history->fromJson($this->history->toJSON());
|
||||
|
||||
$this->assertEquals($history, $this->history);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user