From db47ea7b48bd9d66b61be14246c9a2a7312f6438 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 27 Mar 2014 12:13:41 +0530 Subject: [PATCH] API test fixes --- CRM/Financial/BAO/FinancialAccount.php | 2 +- CRM/Mailing/BAO/Component.php | 2 +- api/v3/examples/Contribution/Create.php | 2 -- api/v3/utils.php | 4 +++- tests/phpunit/CRM/Batch/Form/EntryTest.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CRM/Financial/BAO/FinancialAccount.php b/CRM/Financial/BAO/FinancialAccount.php index 0be4ddef5d..01972087f6 100644 --- a/CRM/Financial/BAO/FinancialAccount.php +++ b/CRM/Financial/BAO/FinancialAccount.php @@ -95,7 +95,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco * @static * @return object */ - static function add(&$params, &$ids) { + static function add(&$params, &$ids = array()) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, FALSE); $params['is_tax'] = CRM_Utils_Array::value('is_tax', $params, FALSE); diff --git a/CRM/Mailing/BAO/Component.php b/CRM/Mailing/BAO/Component.php index 86950253e9..7057aebfbb 100644 --- a/CRM/Mailing/BAO/Component.php +++ b/CRM/Mailing/BAO/Component.php @@ -89,7 +89,7 @@ class CRM_Mailing_BAO_Component extends CRM_Mailing_DAO_Component { * @access public * @static */ - static function add(&$params, &$ids) { + static function add(&$params, &$ids = array()) { // action is taken depending upon the mode $component = new CRM_Mailing_DAO_Component(); $component->name = $params['name']; diff --git a/api/v3/examples/Contribution/Create.php b/api/v3/examples/Contribution/Create.php index abf63b7260..c43b8e855b 100644 --- a/api/v3/examples/Contribution/Create.php +++ b/api/v3/examples/Contribution/Create.php @@ -62,11 +62,9 @@ function contribution_create_expectedresult(){ 'source' => 'SSF', 'amount_level' => '', 'contribution_recur_id' => '', - 'honor_contact_id' => '', 'is_test' => '', 'is_pay_later' => '', 'contribution_status_id' => '2', - 'honor_type_id' => '', 'address_id' => '', 'check_number' => '', 'campaign_id' => '', diff --git a/api/v3/utils.php b/api/v3/utils.php index fee1dffae7..5823ebd6cb 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -321,7 +321,9 @@ function _civicrm_api3_get_DAO($name) { } // Really weird apis can declare their own DAO name. Not sure if this is a good idea... - include_once "api/v3/$name.php"; + if(file_exists("api/v3/$name.php")) { + include_once "api/v3/$name.php"; + } $daoFn = "_civicrm_api3_" . _civicrm_api_get_entity_name_from_camel($name) . "_DAO"; if (function_exists($daoFn)) { return $daoFn(); diff --git a/tests/phpunit/CRM/Batch/Form/EntryTest.php b/tests/phpunit/CRM/Batch/Form/EntryTest.php index 8fb0c47fee..074d904145 100644 --- a/tests/phpunit/CRM/Batch/Form/EntryTest.php +++ b/tests/phpunit/CRM/Batch/Form/EntryTest.php @@ -187,7 +187,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { return array( 'batch_id' => 4, 'primary_profiles' => array(1 => NULL, 2 => NULL, 3 => NULL), - 'primary_contact_select_id' => Array ( + 'primary_contact_id' => Array ( 1 => $this->_contactID, 2 => $this->_contactID2, 3 => $this->_contactID3, -- 2.25.1