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