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/PresentationTest.php
Jay Patel 8c907803e3 [PSR] Fixed Samples
- Using `php-cs-fixer` tool.
2016-07-14 13:12:15 -05:00

59 lines
1.5 KiB
PHP

<?php
namespace PayPal\Test\Api;
use PayPal\Api\Presentation;
/**
* Class Presentation
*
* @package PayPal\Test\Api
*/
class PresentationTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object Presentation
* @return string
*/
public static function getJson()
{
return json_encode(json_decode('{"brand_name":"TestSample","logo_image":"TestSample","locale_code":"TestSample"}'));
}
/**
* Gets Object Instance with Json data filled in
* @return Presentation
*/
public static function getObject()
{
return new Presentation(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return Presentation
*/
public function testSerializationDeserialization()
{
$obj = new Presentation(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getBrandName());
$this->assertNotNull($obj->getLogoImage());
$this->assertNotNull($obj->getLocaleCode());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param Presentation $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getBrandName(), "TestSample");
$this->assertEquals($obj->getLogoImage(), "TestSample");
$this->assertEquals($obj->getLocaleCode(), "TestSample");
}
}