2 class ContributionPage
extends PHPUnit_Framework_Testcase
{
4 * Helper function to create
7 * @return $contributionPage id of created Contribution Page
9 static function create($id = NULL) {
10 require_once "CRM/Contribute/BAO/ContributionPage.php";
12 'title' => 'Help Test CiviCRM!',
13 'intro_text' => 'Created for Test Coverage Online Contribution Page',
14 'financial_type_id' => 1,
15 'payment_processor_id' => $id,
17 'is_allow_other_amount' => 1,
19 'max_amount' => 10000,
20 'goal_amount' => 100000,
21 'thankyou_title' => 'Thanks for Your Support!',
22 'thankyou_text' => 'Thank you for your support.',
23 'is_email_receipt' => 1,
24 'receipt_from_name' => 'From TEST',
25 'receipt_from_email' => 'donations@civicrm.org',
26 'cc_receipt' => 'receipt@example.com',
27 'bcc_receipt' => 'bcc@example.com',
31 $contributionPage = CRM_Contribute_BAO_ContributionPage
::create($params);
32 return $contributionPage->id
;
36 * Helper function to delete a Contribution Page
38 * @param int $contributionPageId - id of the Contribution Page
40 * @return boolean true if Contribution Page deleted, false otherwise
42 static function delete($contributionPageId) {
43 require_once "CRM/Contribute/DAO/ContributionPage.php";
44 $cp = new CRM_Contribute_DAO_ContributionPage();
45 $cp->id
= $contributionPageId;
46 if ($cp->find(TRUE)) {
47 $result = $cp->delete();