Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340885 )

Change subject: WIP Test more fields on import
......................................................................

WIP Test more fields on import

Errr, dang. I thought this would fail without being rebased on top of
awight's fix

Change-Id: I4d595f751866b3eb135d421ac21018b30a998d14
---
M sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php
1 file changed, 32 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/85/340885/1

diff --git 
a/sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php 
b/sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php
index c1d2284..7df0dd4 100644
--- a/sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php
+++ b/sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php
@@ -81,17 +81,46 @@
 
         $contribution = civicrm_api3('Contribution', 'getsingle', array(
           wmf_civicrm_get_custom_field_name('gateway_txn_id') => 
$message->getGatewayTxnId(),
-          'return' => array(wmf_civicrm_get_custom_field_name('Campaign'), 
'total_amount'),
         ));
         
$this->assertEmpty($contribution[wmf_civicrm_get_custom_field_name('campaign')] 
);
+        $expected = array(
+          'contact_type' => 'Individual',
+          'sort_name' => 'laast, firrst',
+          'display_name' => 'firrst laast',
+          'currency' => 'USD',
+          'total_amount' => '400.00',
+          'fee_amount' => '0.00',
+          'net_amount' => '400.00',
+          'trxn_id' => 'GLOBALCOLLECT ' . $message->getGatewayTxnId(),
+          'contribution_source' => 'USD 400',
+          'financial_type' => 'Cash',
+          'accounting_code' => 'CASH',
+          'contribution_status' => 'Completed',
+          'payment_instrument' => 'Credit Card: Visa'
+        );
+        $this->assertArraySubset( $expected, $contribution );
 
         $contribution2 = civicrm_api3('Contribution', 'getsingle', array(
           wmf_civicrm_get_custom_field_name('gateway_txn_id') => 
$message2->getGatewayTxnId(),
-          'return' => array(wmf_civicrm_get_custom_field_name('Campaign'), 
'total_amount'),
         ));
 
         $this->assertEquals('Benefactor Gift', 
$contribution2[wmf_civicrm_get_custom_field_name('campaign')] );
-
+        $expected = array(
+          'contact_type' => 'Individual',
+          'sort_name' => 'laast, firrst',
+          'display_name' => 'firrst laast',
+          'currency' => 'USD',
+          'total_amount' => '2857.02',
+          'fee_amount' => '0.00',
+          'net_amount' => '2857.02',
+          'trxn_id' => 'GLOBALCOLLECT ' . $message2->getGatewayTxnId(),
+          'contribution_source' => 'PLN 952.34',
+          'financial_type' => 'Cash',
+          'accounting_code' => 'CASH',
+          'contribution_status' => 'Completed',
+          'payment_instrument' => 'Credit Card: Visa'
+        );
+        $this->assertArraySubset( $expected, $contribution2 );
         $this->assertNotEquals( $contribution['contact_id'], 
$contribution2['contact_id'] );
     }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/340885
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d595f751866b3eb135d421ac21018b30a998d14
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to