From dbf668ee1f71befb3e5d7fa38c04bd456790ffe4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 29 Jan 2021 21:45:07 -0500 Subject: [PATCH] Remove campaign pseudoconstants from tests --- tests/phpunit/CRM/Core/PseudoConstantTest.php | 53 ------------------- tests/phpunit/CRM/Export/BAO/ExportTest.php | 2 +- 2 files changed, 1 insertion(+), 54 deletions(-) diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index d83d48f28f3..36a1dc33b73 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -81,15 +81,6 @@ public function testOptionValues() { ]; $result = civicrm_api3('payment_processor', 'create', $api_params); - // Create a Campaign for testing. - $campaign_name = md5(microtime()); - $api_params = [ - 'title' => $campaign_name, - 'is_active' => TRUE, - 'status_id' => 2, - ]; - $result = civicrm_api3('campaign', 'create', $api_params); - // Create a membership type for testing. $membership_type = md5(microtime()); $api_params = [ @@ -243,10 +234,6 @@ public function testOptionValues() { 'fieldName' => 'medium_id', 'sample' => 'Phone', ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Campaign_DAO_Campaign' => [ [ @@ -261,10 +248,6 @@ public function testOptionValues() { ], ], 'CRM_Campaign_DAO_Survey' => [ - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], [ 'fieldName' => 'activity_type_id', 'sample' => 'Phone Call', @@ -272,10 +255,6 @@ public function testOptionValues() { ], ], 'CRM_Campaign_DAO_CampaignGroup' => [ - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], [ 'fieldName' => 'group_type', 'sample' => 'Include', @@ -499,10 +478,6 @@ public function testOptionValues() { 'fieldName' => 'payment_instrument_id', 'sample' => 'Check', ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Pledge_DAO_PledgePayment' => [ [ @@ -525,10 +500,6 @@ public function testOptionValues() { 'fieldName' => 'frequency_unit', 'sample' => 'month', ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_PCP_DAO_PCP' => [ [ @@ -778,10 +749,6 @@ public function testOptionValues() { 'sample' => ['USD' => 'US Dollar'], 'max' => 200, ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Event_DAO_Event' => [ [ @@ -809,10 +776,6 @@ public function testOptionValues() { 'sample' => ['USD' => 'US Dollar'], 'max' => 200, ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Core_DAO_Menu' => [ [ @@ -833,10 +796,6 @@ public function testOptionValues() { 'fieldName' => 'status_id', 'sample' => 'New', ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Member_DAO_MembershipStatus' => [ [ @@ -891,10 +850,6 @@ public function testOptionValues() { 'fieldName' => 'visibility', 'sample' => 'Public Pages', ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Mailing_DAO_MailingComponent' => [ [ @@ -967,10 +922,6 @@ public function testOptionValues() { 'fieldName' => 'contribution_page_id', 'sample' => $contribution_page, ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Contribute_DAO_PremiumsProduct' => [ [ @@ -992,10 +943,6 @@ public function testOptionValues() { 'sample' => ['USD' => 'US Dollar'], 'max' => 200, ], - [ - 'fieldName' => 'campaign_id', - 'sample' => $campaign_name, - ], ], 'CRM_Case_DAO_Case' => [ [ diff --git a/tests/phpunit/CRM/Export/BAO/ExportTest.php b/tests/phpunit/CRM/Export/BAO/ExportTest.php index 49d0500a210..fbcc2897148 100644 --- a/tests/phpunit/CRM/Export/BAO/ExportTest.php +++ b/tests/phpunit/CRM/Export/BAO/ExportTest.php @@ -574,7 +574,7 @@ public function testExportPseudoField() { public function testExportPseudoFieldCampaign() { $this->setUpContributionExportData(); $campaign = $this->callAPISuccess('Campaign', 'create', ['title' => 'Big campaign and kinda long too']); - $this->callAPISuccess('Contribution', 'create', ['campaign_id' => 'Big_campaign_and_kinda_long_too', 'id' => $this->contributionIDs[0]]); + $this->callAPISuccess('Contribution', 'create', ['campaign_id' => $campaign['id'], 'id' => $this->contributionIDs[0]]); $selectedFields = [ ['contact_type' => 'Individual', 'name' => 'gender_id'], ['contact_type' => 'Contribution', 'name' => 'contribution_campaign_title'],