forked from LiveCarta/PayPal-PHP-SDK
Updated Invoicing APIs
- Updated Model objects. - Updated Samples. - Updated Tests.
This commit is contained in:
@@ -17,7 +17,7 @@ class InvoiceItemTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public static function getJson()
|
||||
{
|
||||
return '{"name":"TestSample","description":"TestSample","quantity":"12.34","unit_price":' .CurrencyTest::getJson() . ',"tax":' .TaxTest::getJson() . ',"date":"TestSample","discount":' .CostTest::getJson() . '}';
|
||||
return '{"name":"TestSample","description":"TestSample","quantity":"12.34","unit_price":' .CurrencyTest::getJson() . ',"tax":' .TaxTest::getJson() . ',"date":"TestSample","discount":' .CostTest::getJson() . ',"image_url":"http://www.google.com","unit_of_measure":"TestSample"}';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,6 +45,8 @@ class InvoiceItemTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertNotNull($obj->getTax());
|
||||
$this->assertNotNull($obj->getDate());
|
||||
$this->assertNotNull($obj->getDiscount());
|
||||
$this->assertNotNull($obj->getImageUrl());
|
||||
$this->assertNotNull($obj->getUnitOfMeasure());
|
||||
$this->assertEquals(self::getJson(), $obj->toJson());
|
||||
return $obj;
|
||||
}
|
||||
@@ -62,6 +64,18 @@ class InvoiceItemTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals($obj->getTax(), TaxTest::getObject());
|
||||
$this->assertEquals($obj->getDate(), "TestSample");
|
||||
$this->assertEquals($obj->getDiscount(), CostTest::getObject());
|
||||
$this->assertEquals($obj->getImageUrl(), "http://www.google.com");
|
||||
$this->assertEquals($obj->getUnitOfMeasure(), "TestSample");
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedExceptionMessage ImageUrl is not a fully qualified URL
|
||||
*/
|
||||
public function testUrlValidationForImageUrl()
|
||||
{
|
||||
$obj = new InvoiceItem();
|
||||
$obj->setImageUrl(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user