*/
public static function processPremium($params, $contributionID, $premiumID = NULL, $options = array()) {
$selectedProductID = $params['product_name'][0];
- $selectedProductOptionID = $params['product_name'][1];
+ $selectedProductOptionID = CRM_Utils_Array::value(1, $params['product_name']);
$dao = new CRM_Contribute_DAO_ContributionProduct();
$dao->contribution_id = $contributionID;
}
- if ($contribution->id && !empty($formValues['product_name'][0])) {
+ if ($contribution->id && isset($formValues['product_name'][0])) {
CRM_Contribute_Form_AdditionalInfo::processPremium($submittedValues, $contribution->id,
$this->_premiumID, $this->_options
);
$this->openCiviPage("admin/contribute/managePremiums", "action=add&reset=1");
// add premium
$this->addPremium($premiumName, $sku, $amount, $price, $cost, $financialType['name']);
-
// add contribution with premium
$this->openCiviPage("contribute/add", "reset=1&action=add&context=standalone");
//Assertions
$actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'");
- $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium");
+ $this->assertEquals($actualAmount, null, "Verify actual cost for deleted premium");
}
public function testChangePaymentInstrument() {