4 * Class ContributionPage
6 class ContributionPage
extends PHPUnit_Framework_Testcase
{
8 * Helper function to create
13 * @return mixed $contributionPage id of created Contribution Page
15 public static function create($id = NULL) {
16 require_once "CRM/Contribute/BAO/ContributionPage.php";
18 'title' => 'Help Test CiviCRM!',
19 'intro_text' => 'Created for Test Coverage Online Contribution Page',
20 'financial_type_id' => 1,
21 'payment_processor_id' => $id,
23 'is_allow_other_amount' => 1,
25 'max_amount' => 10000,
26 'goal_amount' => 100000,
27 'thankyou_title' => 'Thank you for your support!',
28 'thankyou_text' => 'Thank you for your support.',
29 'is_email_receipt' => 1,
30 'receipt_from_name' => 'From TEST',
31 'receipt_from_email' => 'donations@civicrm.org',
32 'cc_receipt' => 'receipt@example.com',
33 'bcc_receipt' => 'bcc@example.com',
37 $contributionPage = CRM_Contribute_BAO_ContributionPage
::create($params);
38 return $contributionPage->id
;
42 * Helper function to delete a Contribution Page
44 * @param int $contributionPageId - id of the Contribution Page
46 * @return boolean true if Contribution Page deleted, false otherwise
48 public static function delete($contributionPageId) {
49 require_once "CRM/Contribute/DAO/ContributionPage.php";
50 $cp = new CRM_Contribute_DAO_ContributionPage();
51 $cp->id
= $contributionPageId;
52 if ($cp->find(TRUE)) {
53 $result = $cp->delete();