];
$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 = [
'fieldName' => 'medium_id',
'sample' => 'Phone',
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Campaign_DAO_Campaign' => [
[
],
],
'CRM_Campaign_DAO_Survey' => [
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
[
'fieldName' => 'activity_type_id',
'sample' => 'Phone Call',
],
],
'CRM_Campaign_DAO_CampaignGroup' => [
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
[
'fieldName' => 'group_type',
'sample' => 'Include',
'fieldName' => 'payment_instrument_id',
'sample' => 'Check',
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Pledge_DAO_PledgePayment' => [
[
'fieldName' => 'frequency_unit',
'sample' => 'month',
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_PCP_DAO_PCP' => [
[
'sample' => ['USD' => 'US Dollar'],
'max' => 200,
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Event_DAO_Event' => [
[
'sample' => ['USD' => 'US Dollar'],
'max' => 200,
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Core_DAO_Menu' => [
[
'fieldName' => 'status_id',
'sample' => 'New',
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Member_DAO_MembershipStatus' => [
[
'fieldName' => 'visibility',
'sample' => 'Public Pages',
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Mailing_DAO_MailingComponent' => [
[
'fieldName' => 'contribution_page_id',
'sample' => $contribution_page,
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Contribute_DAO_PremiumsProduct' => [
[
'sample' => ['USD' => 'US Dollar'],
'max' => 200,
],
- [
- 'fieldName' => 'campaign_id',
- 'sample' => $campaign_name,
- ],
],
'CRM_Case_DAO_Case' => [
[
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'],