testcases updated

updated testcases to match new json schema
and updates with camel case function names
This commit is contained in:
Ganesh Hegde
2013-05-28 10:08:34 +05:30
parent 125a7b66f3
commit 50b09bdbde
22 changed files with 179 additions and 197 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Api\Links;
use PayPal\Test\Constants;
class LinksTest extends \PHPUnit_Framework_TestCase {
private $links;
public static $href = "USD";
public static $rel = "1.12";
public static $method = "1.12";
public static function createLinks() {
$links = new Links();
$links->setHref(self::$href);
$links->setRel(self::$rel);
$links->setMethod(self::$method);
return $links;
}
public function setup() {
$this->links = self::createLinks();
}
public function testGetterSetters() {
$this->assertEquals(self::$href, $this->links->getHref());
$this->assertEquals(self::$rel, $this->links->getRel());
$this->assertEquals(self::$method, $this->links->getMethod());
}
public function testSerializeDeserialize() {
$link2 = new Links();
$link2->fromJson($this->links->toJSON());
$this->assertEquals($this->links, $link2);
}
}