Fixes to Agreement Search Transaction TimeStamp Parameter

- Updated TimeUpdate parameter to TimeStamp
- Updated Tests accordingly.
- Updated Samples accordingly
- Fixes #221
This commit is contained in:
japatel
2015-01-23 12:30:23 -06:00
parent 4326394447
commit d9a5baf202
6 changed files with 142 additions and 21 deletions

View File

@@ -18,7 +18,7 @@ class AgreementTransactionTest extends \PHPUnit_Framework_TestCase
*/
public static function getJson()
{
return '{"transaction_id":"TestSample","status":"TestSample","transaction_type":"TestSample","amount":' .CurrencyTest::getJson() . ',"fee_amount":' .CurrencyTest::getJson() . ',"net_amount":' .CurrencyTest::getJson() . ',"payer_email":"TestSample","payer_name":"TestSample","time_updated":"TestSample","time_zone":"TestSample"}';
return '{"transaction_id":"TestSample","status":"TestSample","transaction_type":"TestSample","amount":' .CurrencyTest::getJson() . ',"fee_amount":' .CurrencyTest::getJson() . ',"net_amount":' .CurrencyTest::getJson() . ',"payer_email":"TestSample","payer_name":"TestSample","time_stamp":"TestSample","time_zone":"TestSample"}';
}
/**
@@ -47,7 +47,7 @@ class AgreementTransactionTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($obj->getNetAmount());
$this->assertNotNull($obj->getPayerEmail());
$this->assertNotNull($obj->getPayerName());
$this->assertNotNull($obj->getTimeUpdated());
$this->assertNotNull($obj->getTimeStamp());
$this->assertNotNull($obj->getTimeZone());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
@@ -67,7 +67,7 @@ class AgreementTransactionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($obj->getNetAmount(), CurrencyTest::getObject());
$this->assertEquals($obj->getPayerEmail(), "TestSample");
$this->assertEquals($obj->getPayerName(), "TestSample");
$this->assertEquals($obj->getTimeUpdated(), "TestSample");
$this->assertEquals($obj->getTimeStamp(), "TestSample");
$this->assertEquals($obj->getTimeZone(), "TestSample");
}

View File

@@ -175,7 +175,8 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase
*/
public function testGetTransactions($agreement)
{
$result = Agreement::searchTransactions($agreement->getId(),array('start_date' => '2013-01-01', 'end_date' => '2015-01-20'), null, $this->mockPayPalRestCall);
$params = array('start_date' => date('Y-m-d', strtotime('-15 years')), 'end_date' => date('Y-m-d', strtotime('+5 days')));
$result = Agreement::searchTransactions($agreement->getId(), $params, null, $this->mockPayPalRestCall);
$this->assertNotNull($result);
$this->assertTrue(is_array($result->getAgreementTransactionList()));
$this->assertTrue(sizeof($result->getAgreementTransactionList()) > 0);