unit test fixes 4.7beta4
authormonishdeb <monish.deb@webaccessglobal.com>
Tue, 29 Dec 2015 14:18:39 +0000 (19:48 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Tue, 29 Dec 2015 14:18:39 +0000 (19:48 +0530)
CRM/Contribute/BAO/Contribution.php
tests/phpunit/api/v3/CustomValueTest.php

index 74c6aefcff83c89b863bbd6e85d1046c80d58f57..3582ef87a0f7c2cdc8e9027c215d5746183f476e 100644 (file)
@@ -3062,7 +3062,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
         $trxnParams['trxn_date'] = !empty($params['contribution']->cancel_date) ? $params['contribution']->cancel_date : date('YmdHis');
       }
       //CRM-16259, set is_payment flag for non pending status
-      if (!in_array(CRM_Utils_Array::value('contribution_status_id', $params), $pendingStatus)) {
+      if (!in_array($contributionStatus, $pendingStatus)) {
         $trxnParams['is_payment'] = 1;
       }
       if (!empty($params['payment_processor'])) {
index 05dde076c550e2539f06df03f3e71d2146796c5f..b1fa3cb66d008394a3d938377a8ec854e018a82f 100644 (file)
@@ -109,14 +109,15 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
 
     foreach ($customFieldDataType as $dataType => $label) {
       switch ($dataType) {
+        case 'Country':
+        case 'StateProvince':
+          $this->foreignKeyChecksOff();
         case 'String':
         case 'Link':
         case 'Int':
         case 'Float':
         case 'Money':
         case 'Date':
-        case 'Country':
-        case 'StateProvince':
         case 'Boolean':
 
           //Based on the custom field data-type choose desired SQL operators(to test with) and basic $type