From: eileen Date: Wed, 21 Nov 2018 21:22:44 +0000 (+1300) Subject: Set trxn_id & invoice_id in tests as needed rather than by default. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=360a0925d17e345a6bae5b8154b0aa4c4df9efec;p=civicrm-core.git Set trxn_id & invoice_id in tests as needed rather than by default. This causes work-arounds & flakiness by tests using this fn. Better to add as required. --- diff --git a/tests/phpunit/CRM/Financial/Page/AjaxTest.php b/tests/phpunit/CRM/Financial/Page/AjaxTest.php index 25aa5add3d..87850752a1 100644 --- a/tests/phpunit/CRM/Financial/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Financial/Page/AjaxTest.php @@ -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) diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index 7641ab34f1..0aea32679e 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -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) { diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index ae350e1f5c..76a9d3f5c7 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -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); diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 73540669e1..8cf1232c89 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -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);