From c39e27f20010ee76c0bf4ddf7834cd67598fbb75 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 27 Jan 2016 03:27:20 +0530 Subject: [PATCH] CRM-16188, added test for changes for commit https://github.com/JMAConsulting/civicrm-core/commit/4a517906b390b7e9e73c77902f3a3ebf43c1ac15 ---------------------------------------- * CRM-16188: Create an order API https://issues.civicrm.org/jira/browse/CRM-16188 --- tests/phpunit/api/v3/OrderTest.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/api/v3/OrderTest.php b/tests/phpunit/api/v3/OrderTest.php index dc191b506c..1e57ed095d 100644 --- a/tests/phpunit/api/v3/OrderTest.php +++ b/tests/phpunit/api/v3/OrderTest.php @@ -63,7 +63,7 @@ class api_v3_OrderTest extends CiviUnitTestCase { } /** - * Test Get Payment api. + * Test Get order api. */ public function testGetOrder() { $contribution = $this->addOrder(FALSE, 100); @@ -97,6 +97,25 @@ class api_v3_OrderTest extends CiviUnitTestCase { )); } + /** + * Test Get Order api for participant contribution. + */ + public function testGetOrderParticipant() { + $contribution = $this->addOrder(FALSE, 100); + list($items, $contribution) = $this->createParticipantWithContribution(); + + $params = array( + 'contribution_id' => $contribution['id'], + ); + + $order = $this->callAPISuccess('Order', 'get', $params); + + $this->assertEquals(2, count($order['values'][$contribution['id']]['line_items'])); + $this->callAPISuccess('Contribution', 'Delete', array( + 'id' => $contribution['id'], + )); + } + /** * Function to assert db values */ -- 2.25.1