コード例 #1
0
 /**
  * Test copy() method
  */
 public function testcopy()
 {
     $params = array('qfkey' => '9a3ef3c08879ad4c8c109b21c583400e', 'title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, 'intro_text' => '', 'footer_text' => 'Thanks', 'is_for_organization' => 0, 'for_organization' => ' I am contributing on behalf of an organization', 'goal_amount' => '400', 'is_active' => 1, 'honor_block_title' => '', 'honor_block_text' => '', 'start_date' => '20091022105900', 'start_date_time' => '10:59AM', 'end_date' => '19700101000000', 'end_date_time' => '', 'is_credit_card_only' => '');
     $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
     $copycontributionpage = CRM_Contribute_BAO_ContributionPage::copy($contributionpage->id);
     $this->assertEquals($copycontributionpage->financial_type_id, $this->_financialTypeID, 'Check for Financial type id.');
     $this->assertEquals($copycontributionpage->goal_amount, 400, 'Check for goal amount.');
     ContributionPage::delete($contributionpage->id);
     ContributionPage::delete($copycontributionpage->id);
 }
コード例 #2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     parent::setUp();
     $this->_contributionPageId = ContributionPage::create();
 }
コード例 #3
0
 /**
  * test checkRecurPaymentProcessor() method
  */
 function testcheckRecurPaymentProcessor()
 {
     //@todo paypalpro create seems to fail silently without causing this class to fail
     // $this->paymentProcessorCreate may be a better option
     $paymentProcessor = PaypalPro::create();
     $params = array('title' => 'Test Contribution Page', 'financial_type_id' => $this->_financialTypeID, 'is_active' => 1, 'payment_processor_id' => $paymentProcessor);
     $contributionpage = CRM_Contribute_BAO_ContributionPage::create($params);
     $id = $contributionpage->id;
     $checkRecurring = CRM_Contribute_BAO_ContributionPage::checkRecurPaymentProcessor($id);
     $this->assertEquals($checkRecurring, FALSE, 'Check for false return.');
     ContributionPage::delete($contributionpage->id);
 }