ea9469f2568fe61eaf8eed3b91510f09bd798d01
[WP-Plugins/glm-member-db.git] /
1 <?php
2
3 namespace PayPal\Test\Api;
4
5 use PayPal\Api\Payee;
6 use PayPal\Test\Constants;
7
8 class PayeeTest extends \PHPUnit_Framework_TestCase {
9
10         private $payee;
11
12         public static $email = "test@paypal.com";
13         public static $merchant_id = "1XY12121";
14         public static $phone = "+14081234566";
15         
16
17         public static function createPayee() {
18                 $payee = new Payee();
19                 $payee->setEmail(self::$email);
20                 $payee->setMerchantId(self::$merchant_id);
21                 $payee->setPhone(self::$phone);         
22                 
23                 return $payee;
24         }
25         
26         public function setup() {
27                 $this->payee = self::createPayee();
28         }
29
30         public function testGetterSetter() {
31                 $this->assertEquals(self::$email, $this->payee->getEmail());
32                 $this->assertEquals(self::$merchant_id, $this->payee->getMerchantId());
33                 $this->assertEquals(self::$phone, $this->payee->getPhone());
34         }
35         
36         public function testSerializeDeserialize() {
37                 $p1 = $this->payee;
38                 
39                 $p2 = new Payee();
40                 $p2->fromJson($p1->toJson());
41                 
42                 $this->assertEquals($p1, $p2);
43         }
44 }