This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/tests/PayPal/Test/Api/PlanListTest.php
Jay Patel 8c907803e3 [PSR] Fixed Samples
- Using `php-cs-fixer` tool.
2016-07-14 13:12:15 -05:00

61 lines
1.6 KiB
PHP

<?php
namespace PayPal\Test\Api;
use PayPal\Api\PlanList;
/**
* Class PlanList
*
* @package PayPal\Test\Api
*/
class PlanListTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object PlanList
* @return string
*/
public static function getJson()
{
return '{"plans":' .PlanTest::getJson() . ',"total_items":"TestSample","total_pages":"TestSample","links":' .LinksTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
* @return PlanList
*/
public static function getObject()
{
return new PlanList(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return PlanList
*/
public function testSerializationDeserialization()
{
$obj = new PlanList(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getPlans());
$this->assertNotNull($obj->getTotalItems());
$this->assertNotNull($obj->getTotalPages());
$this->assertNotNull($obj->getLinks());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param PlanList $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getPlans(), PlanTest::getObject());
$this->assertEquals($obj->getTotalItems(), "TestSample");
$this->assertEquals($obj->getTotalPages(), "TestSample");
$this->assertEquals($obj->getLinks(), LinksTest::getObject());
}
}