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