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/BillingInfoTest.php
japatel b011d17cde Removed Deprecated Getter and Setters
- Removed Deprecated Getter Setters from all Model Classes
- All Camelcase getters and setters are removed. Please use first letter uppercase syntax
- E.g. instead of using get_notify_url(), use getNotifyUrl() instead
2015-01-08 22:23:58 -06:00

73 lines
2.4 KiB
PHP

<?php
namespace PayPal\Test\Api;
use PayPal\Common\PayPalModel;
use PayPal\Api\BillingInfo;
/**
* Class BillingInfo
*
* @package PayPal\Test\Api
*/
class BillingInfoTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object BillingInfo
* @return string
*/
public static function getJson()
{
return '{"email":"TestSample","first_name":"TestSample","last_name":"TestSample","business_name":"TestSample","address":' .InvoiceAddressTest::getJson() . ',"language":"TestSample","additional_info":"TestSample","notification_channel":"TestSample","phone":' .PhoneTest::getJson() . '}';
}
/**
* Gets Object Instance with Json data filled in
* @return BillingInfo
*/
public static function getObject()
{
return new BillingInfo(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return BillingInfo
*/
public function testSerializationDeserialization()
{
$obj = new BillingInfo(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getEmail());
$this->assertNotNull($obj->getFirstName());
$this->assertNotNull($obj->getLastName());
$this->assertNotNull($obj->getBusinessName());
$this->assertNotNull($obj->getAddress());
$this->assertNotNull($obj->getLanguage());
$this->assertNotNull($obj->getAdditionalInfo());
$this->assertNotNull($obj->getNotificationChannel());
$this->assertNotNull($obj->getPhone());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param BillingInfo $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getEmail(), "TestSample");
$this->assertEquals($obj->getFirstName(), "TestSample");
$this->assertEquals($obj->getLastName(), "TestSample");
$this->assertEquals($obj->getBusinessName(), "TestSample");
$this->assertEquals($obj->getAddress(), InvoiceAddressTest::getObject());
$this->assertEquals($obj->getLanguage(), "TestSample");
$this->assertEquals($obj->getAdditionalInfo(), "TestSample");
$this->assertEquals($obj->getNotificationChannel(), "TestSample");
$this->assertEquals($obj->getPhone(), PhoneTest::getObject());
}
}