![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mcoil.corals.io/vendor/paypal/rest-api-sdk-php/tests/PayPal/Test/Api/ |
<?php namespace PayPal\Test\Api; use PayPal\Api\Links; /** * Class Links * * @package PayPal\Test\Api */ class LinksTest extends \PHPUnit_Framework_TestCase { /** * Gets Json String of Object Links * @return string */ public static function getJson() { return '{"href":"TestSample","rel":"TestSample","targetSchema":' .HyperSchemaTest::getJson() . ',"method":"TestSample","enctype":"TestSample","schema":' .HyperSchemaTest::getJson() . '}'; } /** * Gets Object Instance with Json data filled in * @return Links */ public static function getObject() { return new Links(self::getJson()); } /** * Tests for Serialization and Deserialization Issues * @return Links */ public function testSerializationDeserialization() { $obj = new Links(self::getJson()); $this->assertNotNull($obj); $this->assertNotNull($obj->getHref()); $this->assertNotNull($obj->getRel()); $this->assertNotNull($obj->getTargetSchema()); $this->assertNotNull($obj->getMethod()); $this->assertNotNull($obj->getEnctype()); $this->assertNotNull($obj->getSchema()); $this->assertEquals(self::getJson(), $obj->toJson()); return $obj; } /** * @depends testSerializationDeserialization * @param Links $obj */ public function testGetters($obj) { $this->assertEquals($obj->getHref(), "TestSample"); $this->assertEquals($obj->getRel(), "TestSample"); $this->assertEquals($obj->getTargetSchema(), HyperSchemaTest::getObject()); $this->assertEquals($obj->getMethod(), "TestSample"); $this->assertEquals($obj->getEnctype(), "TestSample"); $this->assertEquals($obj->getSchema(), HyperSchemaTest::getObject()); } }