3 namespace PayPal\Test\Api;
5 use PayPal\Api\PaymentHistory;
6 use PayPal\Test\Constants;
8 class PaymentHistoryTest extends \PHPUnit_Framework_TestCase {
12 public static $count = "10";
13 public static $nextId = "11";
15 public static function createPaymentHistory() {
16 $history = new PaymentHistory();
17 $history->setCount(self::$count);
18 $history->setNextId(self::$nextId);
19 $history->setPayments(array(PaymentTest::createPayment()));
22 public function setup() {
23 $this->history = PaymentHistoryTest::createPaymentHistory();
26 public function testGetterSetters() {
27 $this->assertEquals(self::$count, $this->history->getCount());
28 $this->assertEquals(self::$nextId, $this->history->getNextId());
32 public function testSerializeDeserialize() {
33 $history = new PaymentHistory();
34 $history->fromJson($this->history->toJSON());
36 $this->assertEquals($history, $this->history);