577d2828f1b22b2c7c35515455645eca9571b264
[WP-Plugins/glm-member-db-registrations.git] /
1 <?php
2
3 namespace PayPal\Test\Api;
4
5 use PayPal\Api\PaymentHistory;
6 use PayPal\Test\Constants;
7
8 class PaymentHistoryTest extends \PHPUnit_Framework_TestCase {
9         
10         private $history;
11         
12         public static $count = "10";
13         public static $nextId = "11";
14         
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()));
20                 return $history;
21         }
22         public function setup() {               
23                 $this->history = PaymentHistoryTest::createPaymentHistory();
24         }
25         
26         public function testGetterSetters() {
27                 $this->assertEquals(self::$count, $this->history->getCount());
28                 $this->assertEquals(self::$nextId, $this->history->getNextId());
29                 
30         }
31         
32         public function testSerializeDeserialize() {
33                 $history = new PaymentHistory();
34                 $history->fromJson($this->history->toJSON());
35         
36                 $this->assertEquals($history, $this->history);
37         }
38         
39 }