3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Trait CRMTraits_PCP_PCPTestTrait
15 * Traits for testing PCP pages.
17 trait CRMTraits_PCP_PCPTestTrait
{
20 * Build and return pcpBlock params.
22 * Create the necessary initial objects for a pcpBlock, then return the
23 * params needed to create the pcpBlock.
26 public function pcpBlockParams() {
27 $contribPage = CRM_Core_DAO
::createTestObject('CRM_Contribute_DAO_ContributionPage');
28 $contribPageId = $contribPage->id
;
29 $supporterProfile = CRM_Core_DAO
::createTestObject('CRM_Core_DAO_UFGroup');
30 $supporterProfileId = $supporterProfile->id
;
33 'entity_table' => 'civicrm_contribution_page',
34 'entity_id' => $contribPageId,
35 'supporter_profile_id' => $supporterProfileId,
36 'target_entity_id' => 1,
37 'is_approval_needed' => 1,
38 'is_tellfriend_enabled' => 1,
39 'tellfriend_limit' => 1,
40 'link_text' => 'Create your own PCP',
48 * Build and return pcp params.
50 * Create the necessary initial objects for a pcp page, then return the
51 * params needed to create the pcp page.
53 public function pcpParams() {
54 $contact = CRM_Core_DAO
::createTestObject('CRM_Contact_DAO_Contact');
55 $contactId = $contact->id
;
56 $contribPage = CRM_Core_DAO
::createTestObject('CRM_Contribute_DAO_ContributionPage');
57 $contribPageId = $contribPage->id
;
60 'contact_id' => $contactId,
63 'intro_text' => 'Hey you, contribute now!',
64 'page_text' => 'You better give more.',
65 'donate_link_text' => 'Donate Now',
66 'page_id' => $contribPageId,
67 'is_thermometer' => 1,
69 'goal_amount' => 10000.00,