--CRM-16259, updated api test for get action
authorPradeep Nayak <pradpnayak@gmail.com>
Wed, 20 Jan 2016 12:28:50 +0000 (17:58 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 20 Jan 2016 12:28:50 +0000 (17:58 +0530)
tests/phpunit/api/v3/PaymentTest.php

index a896791991e61d3aa619d6dd6e07acdb963b326f..f6eadcb9c393cb5d6a6b913cf78445ffca367371 100644 (file)
@@ -118,11 +118,14 @@ class api_v3_PaymentTest extends CiviUnitTestCase {
     $payment = $this->callAPIAndDocument('payment', 'get', $params, __FUNCTION__, __FILE__);
 
     $this->assertEquals(1, $payment['count']);
-    $this->assertEquals($payment['values'][$payment['id']]['total_amount'], 100.00);
-    $this->assertEquals($payment['values'][$payment['id']]['trxn_id'], 23456);
-    $this->assertEquals($payment['values'][$payment['id']]['trxn_date'], '2010-01-20 00:00:00');
-    $this->assertEquals($payment['values'][$payment['id']]['is_payment'], 1);
-    $this->assertEquals($payment['values'][$payment['id']]['contribution_id'], $contribution['id']);
+    $expectedResult = array(
+      'total_amount' => 100,
+      'trxn_id' => 23456,
+      'trxn_date' => '2010-01-20 00:00:00',
+      'contribution_id' => $contribution['id'],
+      'is_payment' => 1,
+    );
+    $this->checkPaymentResult($payment, $expectedResult);
     $this->callAPISuccess('Contribution', 'Delete', array(
       'id' => $contribution['id'],
     ));