68da69a86d86d55703b7a4addf99383189dbd276
[WP-Plugins/glm-member-db.git] /
1 <?php
2
3 namespace PayPal\Test\Api;
4
5 use PayPal\Api\Links;
6 use PayPal\Test\Constants;
7
8 class LinksTest extends \PHPUnit_Framework_TestCase {
9
10         private $links;
11
12         public static $href = "USD";
13         public static $rel = "1.12";
14         public static $method = "1.12";
15         
16         public static function createLinks() {
17                 $links = new Links();
18                 $links->setHref(self::$href);
19                 $links->setRel(self::$rel);
20                 $links->setMethod(self::$method);
21                 
22                 return $links;
23         }
24         
25         public function setup() {
26                 $this->links = self::createLinks();
27         }
28         
29         public function testGetterSetters() {
30                 $this->assertEquals(self::$href, $this->links->getHref());
31                 $this->assertEquals(self::$rel, $this->links->getRel());
32                 $this->assertEquals(self::$method, $this->links->getMethod());
33         }
34         
35         public function testSerializeDeserialize() {
36                 $link2 = new Links();
37                 $link2->fromJson($this->links->toJSON());
38                 $this->assertEquals($this->links, $link2);
39         }
40 }