forked from LiveCarta/PayPal-PHP-SDK
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
This commit is contained in:
@@ -103,144 +103,6 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getAdditionalData(), "TestSample");
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSerializationDeserialization
|
||||
* @param Invoice $obj
|
||||
*/
|
||||
public function testDeprecatedGetters($obj)
|
||||
{
|
||||
$this->assertEquals($obj->getMerchant_info(), MerchantInfoTest::getObject());
|
||||
$this->assertEquals($obj->getBilling_info(), BillingInfoTest::getObject());
|
||||
$this->assertEquals($obj->getShipping_info(), ShippingInfoTest::getObject());
|
||||
$this->assertEquals($obj->getInvoice_date(), "TestSample");
|
||||
$this->assertEquals($obj->getPayment_term(), PaymentTermTest::getObject());
|
||||
$this->assertEquals($obj->getShipping_cost(), ShippingCostTest::getObject());
|
||||
$this->assertEquals($obj->getTax_calculated_after_discount(), true);
|
||||
$this->assertEquals($obj->getTax_inclusive(), true);
|
||||
$this->assertEquals($obj->getMerchant_memo(), "TestSample");
|
||||
$this->assertEquals($obj->getLogo_url(), "http://www.google.com");
|
||||
$this->assertEquals($obj->getTotal_amount(), CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getPayment_details(), PaymentDetailTest::getObject());
|
||||
$this->assertEquals($obj->getRefund_details(), RefundDetailTest::getObject());
|
||||
$this->assertEquals($obj->getAdditional_data(), "TestSample");
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testSerializationDeserialization
|
||||
* @param Invoice $obj
|
||||
*/
|
||||
public function testDeprecatedSetterNormalGetter($obj)
|
||||
{
|
||||
|
||||
// Check for Merchant_info
|
||||
$obj->setMerchantInfo(null);
|
||||
$this->assertNull($obj->getMerchant_info());
|
||||
$this->assertNull($obj->getMerchantInfo());
|
||||
$this->assertSame($obj->getMerchantInfo(), $obj->getMerchant_info());
|
||||
$obj->setMerchant_info(MerchantInfoTest::getObject());
|
||||
$this->assertEquals($obj->getMerchant_info(), MerchantInfoTest::getObject());
|
||||
|
||||
// Check for Billing_info
|
||||
$obj->setBillingInfo(null);
|
||||
$this->assertNull($obj->getBilling_info());
|
||||
$this->assertNull($obj->getBillingInfo());
|
||||
$this->assertSame($obj->getBillingInfo(), $obj->getBilling_info());
|
||||
$obj->setBilling_info(BillingInfoTest::getObject());
|
||||
$this->assertEquals($obj->getBilling_info(), BillingInfoTest::getObject());
|
||||
|
||||
// Check for Shipping_info
|
||||
$obj->setShippingInfo(null);
|
||||
$this->assertNull($obj->getShipping_info());
|
||||
$this->assertNull($obj->getShippingInfo());
|
||||
$this->assertSame($obj->getShippingInfo(), $obj->getShipping_info());
|
||||
$obj->setShipping_info(ShippingInfoTest::getObject());
|
||||
$this->assertEquals($obj->getShipping_info(), ShippingInfoTest::getObject());
|
||||
|
||||
// Check for Invoice_date
|
||||
$obj->setInvoiceDate(null);
|
||||
$this->assertNull($obj->getInvoice_date());
|
||||
$this->assertNull($obj->getInvoiceDate());
|
||||
$this->assertSame($obj->getInvoiceDate(), $obj->getInvoice_date());
|
||||
$obj->setInvoice_date("TestSample");
|
||||
$this->assertEquals($obj->getInvoice_date(), "TestSample");
|
||||
|
||||
// Check for Payment_term
|
||||
$obj->setPaymentTerm(null);
|
||||
$this->assertNull($obj->getPayment_term());
|
||||
$this->assertNull($obj->getPaymentTerm());
|
||||
$this->assertSame($obj->getPaymentTerm(), $obj->getPayment_term());
|
||||
$obj->setPayment_term(PaymentTermTest::getObject());
|
||||
$this->assertEquals($obj->getPayment_term(), PaymentTermTest::getObject());
|
||||
|
||||
// Check for Shipping_cost
|
||||
$obj->setShippingCost(null);
|
||||
$this->assertNull($obj->getShipping_cost());
|
||||
$this->assertNull($obj->getShippingCost());
|
||||
$this->assertSame($obj->getShippingCost(), $obj->getShipping_cost());
|
||||
$obj->setShipping_cost(ShippingCostTest::getObject());
|
||||
$this->assertEquals($obj->getShipping_cost(), ShippingCostTest::getObject());
|
||||
|
||||
// Check for Tax_calculated_after_discount
|
||||
$obj->setTaxCalculatedAfterDiscount(null);
|
||||
$this->assertNull($obj->getTax_calculated_after_discount());
|
||||
$this->assertNull($obj->getTaxCalculatedAfterDiscount());
|
||||
$this->assertSame($obj->getTaxCalculatedAfterDiscount(), $obj->getTax_calculated_after_discount());
|
||||
$obj->setTax_calculated_after_discount(true);
|
||||
$this->assertEquals($obj->getTax_calculated_after_discount(), true);
|
||||
|
||||
// Check for Tax_inclusive
|
||||
$obj->setTaxInclusive(null);
|
||||
$this->assertNull($obj->getTax_inclusive());
|
||||
$this->assertNull($obj->getTaxInclusive());
|
||||
$this->assertSame($obj->getTaxInclusive(), $obj->getTax_inclusive());
|
||||
$obj->setTax_inclusive(true);
|
||||
$this->assertEquals($obj->getTax_inclusive(), true);
|
||||
|
||||
// Check for Merchant_memo
|
||||
$obj->setMerchantMemo(null);
|
||||
$this->assertNull($obj->getMerchant_memo());
|
||||
$this->assertNull($obj->getMerchantMemo());
|
||||
$this->assertSame($obj->getMerchantMemo(), $obj->getMerchant_memo());
|
||||
$obj->setMerchant_memo("TestSample");
|
||||
$this->assertEquals($obj->getMerchant_memo(), "TestSample");
|
||||
|
||||
// Check for Total_amount
|
||||
$obj->setTotalAmount(null);
|
||||
$this->assertNull($obj->getTotal_amount());
|
||||
$this->assertNull($obj->getTotalAmount());
|
||||
$this->assertSame($obj->getTotalAmount(), $obj->getTotal_amount());
|
||||
$obj->setTotal_amount(CurrencyTest::getObject());
|
||||
$this->assertEquals($obj->getTotal_amount(), CurrencyTest::getObject());
|
||||
|
||||
// Check for Payment_details
|
||||
$obj->setPaymentDetails(null);
|
||||
$this->assertNull($obj->getPayment_details());
|
||||
$this->assertNull($obj->getPaymentDetails());
|
||||
$this->assertSame($obj->getPaymentDetails(), $obj->getPayment_details());
|
||||
$obj->setPayment_details(PaymentDetailTest::getObject());
|
||||
$this->assertEquals($obj->getPayment_details(), PaymentDetailTest::getObject());
|
||||
|
||||
// Check for Refund_details
|
||||
$obj->setRefundDetails(null);
|
||||
$this->assertNull($obj->getRefund_details());
|
||||
$this->assertNull($obj->getRefundDetails());
|
||||
$this->assertSame($obj->getRefundDetails(), $obj->getRefund_details());
|
||||
$obj->setRefund_details(RefundDetailTest::getObject());
|
||||
$this->assertEquals($obj->getRefund_details(), RefundDetailTest::getObject());
|
||||
|
||||
// Check for Additional_data
|
||||
$obj->setAdditionalData(null);
|
||||
$this->assertNull($obj->getAdditional_data());
|
||||
$this->assertNull($obj->getAdditionalData());
|
||||
$this->assertSame($obj->getAdditionalData(), $obj->getAdditional_data());
|
||||
$obj->setAdditional_data("TestSample");
|
||||
$this->assertEquals($obj->getAdditional_data(), "TestSample");
|
||||
|
||||
//Test All Deprecated Getters and Normal Getters
|
||||
$this->testDeprecatedGetters($obj);
|
||||
$this->testGetters($obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage LogoUrl is not a fully qualified URL
|
||||
@@ -251,12 +113,6 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase
|
||||
$obj->setLogoUrl(null);
|
||||
}
|
||||
|
||||
public function testUrlValidationForLogoUrlDeprecated()
|
||||
{
|
||||
$obj = new Invoice();
|
||||
$obj->setLogo_url(null);
|
||||
$this->assertNull($obj->getLogo_url());
|
||||
}
|
||||
/**
|
||||
* @dataProvider mockProvider
|
||||
* @param Invoice $obj
|
||||
|
||||
Reference in New Issue
Block a user