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

@@ -10,18 +10,15 @@ class CaptureTest extends \PHPUnit_Framework_TestCase {
public static $authorization_id = "AUTH-123";
public static $create_time = "2013-02-28T00:00:00Z";
public static $description = "Test capture";
public static $id = "C-5678";
public static $parent_payment = "PAY-123";
public static $state = "Created";
public static function createCapture() {
$capture = new Capture();
$capture->setAuthorization_id(self::$authorization_id);
$capture->setCreate_time(self::$create_time);
$capture->setDescription(self::$description);
$capture->setCreateTime(self::$create_time);
$capture->setId(self::$id);
$capture->setParent_payment(self::$parent_payment);
$capture->setParentPayment(self::$parent_payment);
$capture->setState(self::$state);
return $capture;
@@ -32,21 +29,19 @@ class CaptureTest extends \PHPUnit_Framework_TestCase {
$capture = self::createCapture();
$capture->setAmount(AmountTest::createAmount());
$capture->setLinks(array(LinkTest::createLink()));
$capture->setLinks(array(LinksTest::createLinks()));
$this->captures['full'] = $capture;
}
public function testGetterSetter() {
$this->assertEquals(self::$authorization_id, $this->captures['partial']->getAuthorization_id());
$this->assertEquals(self::$create_time, $this->captures['partial']->getCreate_time());
$this->assertEquals(self::$description, $this->captures['partial']->getDescription());
$this->assertEquals(self::$create_time, $this->captures['partial']->getCreateTime());
$this->assertEquals(self::$id, $this->captures['partial']->getId());
$this->assertEquals(self::$parent_payment, $this->captures['partial']->getParent_payment());
$this->assertEquals(self::$parent_payment, $this->captures['partial']->getParentPayment());
$this->assertEquals(self::$state, $this->captures['partial']->getState());
$this->assertEquals(AmountTest::$currency, $this->captures['full']->getAmount()->getCurrency());
$links = $this->captures['full']->getLinks();
$this->assertEquals(LinkTest::$href, $links[0]->getHref());
$this->assertEquals(LinksTest::$href, $links[0]->getHref());
}
public function testSerializeDeserialize() {