Fixes to Agreement Search Transaction

- Added searchTransactions method to include params
- Updated Tests accordingly.
- Updated Samples accordingly
This commit is contained in:
japatel
2015-01-20 10:46:22 -06:00
parent baf06a66be
commit 4326394447
8 changed files with 147 additions and 238 deletions

View File

@@ -274,7 +274,7 @@ class AgreementTest extends \PHPUnit_Framework_TestCase
AgreementTransactionsTest::getJson()
));
$result = $obj->transactions("agreementId", $mockApiContext, $mockPayPalRestCall);
$result = $obj->searchTransactions("agreementId", array(), $mockApiContext, $mockPayPalRestCall);
$this->assertNotNull($result);
}

View File

@@ -175,9 +175,13 @@ class BillingAgreementsFunctionalTest extends \PHPUnit_Framework_TestCase
*/
public function testGetTransactions($agreement)
{
$this->markTestSkipped('Skipped as the fix is on the way.');
$result = Agreement::transactions($agreement->getId(), null, $this->mockPayPalRestCall);
$result = Agreement::searchTransactions($agreement->getId(),array('start_date' => '2013-01-01', 'end_date' => '2015-01-20'), null, $this->mockPayPalRestCall);
$this->assertNotNull($result);
$this->assertTrue(is_array($result->getAgreementTransactionList()));
$this->assertTrue(sizeof($result->getAgreementTransactionList()) > 0);
$list = $result->getAgreementTransactionList();
$first = $list[0];
$this->assertEquals($first->getTransactionId(), $agreement->getId());
}
/**