forked from LiveCarta/PayPal-PHP-SDK
Initial commit
This commit is contained in:
40
tests/PayPal/Test/Api/LinkTest.php
Normal file
40
tests/PayPal/Test/Api/LinkTest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Test\Api;
|
||||
|
||||
use PayPal\Api\Link;
|
||||
use PayPal\Test\Constants;
|
||||
|
||||
class LinkTest extends \PHPUnit_Framework_TestCase {
|
||||
|
||||
private $link;
|
||||
|
||||
public static $href = "USD";
|
||||
public static $rel = "1.12";
|
||||
public static $method = "1.12";
|
||||
|
||||
public static function createLink() {
|
||||
$link = new Link();
|
||||
$link->setHref(self::$href);
|
||||
$link->setRel(self::$rel);
|
||||
$link->setMethod(self::$method);
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
public function setup() {
|
||||
$this->link = self::createLink();
|
||||
}
|
||||
|
||||
public function testGetterSetters() {
|
||||
$this->assertEquals(self::$href, $this->link->getHref());
|
||||
$this->assertEquals(self::$rel, $this->link->getRel());
|
||||
$this->assertEquals(self::$method, $this->link->getMethod());
|
||||
}
|
||||
|
||||
public function testSerializeDeserialize() {
|
||||
$link2 = new Link();
|
||||
$link2->fromJson($this->link->toJSON());
|
||||
$this->assertEquals($this->link, $link2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user