From: Eileen McNaughton Date: Wed, 10 Aug 2022 21:39:34 +0000 (+1200) Subject: Stop calling BAO function in test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=143911162d409211966f215be0aa8359d618ae98;p=civicrm-core.git Stop calling BAO function in test --- diff --git a/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php b/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php index e1463439fa..7375c6b1d7 100644 --- a/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php @@ -226,7 +226,10 @@ class CRM_Contribute_Import_Parser_ContributionTest extends CiviUnitTestCase { 'rule_weight' => 10, 'rule_field' => 'phone_numeric', ]); - $fields = CRM_Contribute_BAO_Contribution::importableFields(); + $userJobID = UserJob::create()->setValues(['job_type:name' => 'Import Contributions', 'status_id:name' => 'Draft', 'metadata' => ['contactType' => 'Individual']])->execute()->first()['id']; + $parser = new CRM_Contribute_Import_Parser_Contribution(); + $parser ->setUserJobID($userJobID); + $fields = $parser->getAvailableFields(); $this->assertArrayHasKey('phone', $fields); $this->callApiSuccess('RuleGroup', 'create', [ 'id' => $unsupervisedRuleGroup['id'],