Set trxn_id & invoice_id in tests as needed rather than by default.
authoreileen <emcnaughton@wikimedia.org>
Wed, 21 Nov 2018 21:22:44 +0000 (10:22 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 22 Nov 2018 00:31:01 +0000 (13:31 +1300)
This causes work-arounds & flakiness by tests using this fn.
Better to add as required.

tests/phpunit/CRM/Financial/Page/AjaxTest.php
tests/phpunit/CRM/Member/Form/MembershipTest.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/ContributionTest.php

index 25aa5add3dd912e899040aa9e65e20d1f053e5e6..87850752a153927c449249fd14834b555f47bbbf 100644 (file)
@@ -38,7 +38,7 @@ class CRM_Financial_Page_AjaxTest extends CiviUnitTestCase {
    */
   public function testGetFinancialTransactionsList() {
     $individualID = $this->individualCreate();
-    $this->contributionCreate(array('contact_id' => $individualID));
+    $this->contributionCreate(array('contact_id' => $individualID, 'trxn_id' => 12345));
     $batch = $this->callAPISuccess('Batch', 'create', array('title' => 'test', 'status_id' => 'Open'));
     CRM_Core_DAO::executeQuery("
      INSERT INTO civicrm_entity_batch (entity_table, entity_id, batch_id)
index 7641ab34f1efd64bc08e8f33d879190aa84cb832..0aea32679e39ba0d92ca0c378a6d48a93745b5d6 100644 (file)
@@ -135,6 +135,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
         'civicrm_membership_type',
         'civicrm_membership',
         'civicrm_uf_match',
+        'civicrm_email',
       )
     );
     foreach (array(17, 18, 23, 32) as $contactID) {
index ae350e1f5ce96927d938d9831034cbed2dc8bb5a..76a9d3f5c7553f5f337d64dd19c51a064228e9d8 100644 (file)
@@ -1302,8 +1302,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       'financial_type_id' => 1,
       'payment_instrument_id' => 1,
       'non_deductible_amount' => 10.00,
-      'trxn_id' => 12345,
-      'invoice_id' => 67890,
       'source' => 'SSF',
       'contribution_status_id' => 1,
     ), $params);
index 73540669e1c07ade5d54496ae08b7c1b834a595b..8cf1232c89a8c361117347d2340c2bdad2c106f0 100644 (file)
@@ -267,6 +267,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $params = array_merge($params, array(
       'id' => $contributionID,
       'invoice_number' => CRM_Utils_Array::value('invoice_prefix', Civi::settings()->get('contribution_invoice_settings')) . "" . $contributionID,
+      'trxn_id' => 12345,
+      'invoice_id' => 6789,
     ));
     $contributionID = $this->contributionCreate($params);