From 5be22f3986348bf32b8c7c59ba6d7f0641621aca Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 24 Jan 2017 21:16:04 +1300 Subject: [PATCH] Update test examples. This is not an exhaustive update. It covers a good chunk of the common changes but a lot of copy & paste means the examples are being overwritten by other tests. I have removed some of that --- .../Activity/ContactRefCustomField.php | 4 +- .../Activity/ContactRefCustomFieldGet.php | 3 +- api/v3/examples/Activity/Create.php | 3 +- api/v3/examples/Activity/DateTimeHigh.php | 4 +- api/v3/examples/Activity/DateTimeLow.php | 4 +- api/v3/examples/Activity/Delete.php | 3 +- api/v3/examples/Activity/Get.php | 3 +- api/v3/examples/Activity/GetFields.php | 93 +++++++++- .../Activity/GetTargetandAssignee.php | 4 +- .../Activity/GetTargetandAssigneeName.php | 8 +- .../Activity/ReturnAssigneeContact.php | 4 +- api/v3/examples/ActivityContact/Create.php | 3 +- api/v3/examples/ActivityContact/Delete.php | 3 +- api/v3/examples/ActivityType/Create.php | 3 +- api/v3/examples/ActivityType/Get.php | 9 +- api/v3/examples/Address/AddressLike.php | 3 +- api/v3/examples/Address/AddressParse.php | 3 +- api/v3/examples/Address/AddressSort.php | 3 +- api/v3/examples/Address/Create.php | 3 +- api/v3/examples/Address/Delete.php | 5 +- api/v3/examples/Address/Get.php | 3 +- api/v3/examples/Address/GetOptions.php | 3 +- api/v3/examples/Batch/Create.php | 3 +- api/v3/examples/Batch/Delete.php | 3 +- api/v3/examples/Batch/Get.php | 3 +- api/v3/examples/Campaign/Create.php | 3 +- api/v3/examples/Campaign/Delete.php | 5 +- api/v3/examples/Campaign/Get.php | 3 +- api/v3/examples/Case/Create.php | 3 +- api/v3/examples/CaseContact/Get.php | 77 +++++++++ api/v3/examples/Constant/Get.php | 9 +- api/v3/examples/Contact/APIChainedArray.php | 3 +- .../Contact/APIChainedArrayFormats.php | 3 +- .../Contact/APIChainedArrayMultipleCustom.php | 3 +- ...IChainedArrayValuesFromSiblingFunction.php | 5 +- api/v3/examples/Contact/ChainTwoWebsites.php | 4 +- .../Contact/ChainTwoWebsitesSyntax2.php | 4 +- api/v3/examples/Contact/Create.php | 3 +- api/v3/examples/Contact/CustomFieldGet.php | 3 +- .../CustomFieldGetReturnSyntaxVariation.php | 3 +- api/v3/examples/Contact/Delete.php | 3 +- .../examples/Contact/FormatIsSuccess_Fail.php | 3 +- .../examples/Contact/FormatIsSuccess_True.php | 3 +- api/v3/examples/Contact/FormatOnlyID.php | 3 +- api/v3/examples/Contact/FormatSingleValue.php | 3 +- api/v3/examples/Contact/Get.php | 3 +- api/v3/examples/Contact/GetActions.php | 49 +++--- api/v3/examples/Contact/GetCountContact.php | 3 +- api/v3/examples/Contact/GetFieldsOptions.php | 163 ++++++++++++++++-- api/v3/examples/Contact/GetOptions.php | 3 +- api/v3/examples/Contact/GetSingleContact.php | 3 +- .../Contact/GroupFilterUsingContactAPI.php | 3 +- .../examples/Contact/NestedReplaceEmail.php | 3 +- api/v3/examples/ContributionPage/Create.php | 4 +- api/v3/examples/ContributionPage/Delete.php | 3 +- api/v3/examples/ContributionPage/Get.php | 3 +- api/v3/examples/ContributionPage/Submit.php | 3 +- api/v3/examples/ContributionRecur/Create.php | 6 +- api/v3/examples/ContributionRecur/Delete.php | 3 +- api/v3/examples/ContributionRecur/Get.php | 4 +- api/v3/examples/ContributionSoft/Create.php | 3 +- api/v3/examples/ContributionSoft/Delete.php | 3 +- api/v3/examples/ContributionSoft/Get.php | 3 +- api/v3/examples/Country/Create.php | 3 +- api/v3/examples/Country/Delete.php | 3 +- api/v3/examples/Country/Get.php | 3 +- api/v3/examples/CustomField/Create.php | 3 +- api/v3/examples/CustomField/Delete.php | 3 +- api/v3/examples/CustomGroup/Create.php | 3 +- api/v3/examples/CustomGroup/Delete.php | 3 +- api/v3/examples/CustomGroup/Get.php | 3 +- api/v3/examples/Domain/Create.php | 5 +- api/v3/examples/Domain/Get.php | 9 +- api/v3/examples/Email/Create.php | 3 +- api/v3/examples/Email/Delete.php | 5 +- api/v3/examples/Email/Replace.php | 3 +- api/v3/examples/EntityBatch/Create.php | 80 +++++++++ api/v3/examples/EntityBatch/Delete.php | 70 ++++++++ api/v3/examples/EntityBatch/Get.php | 80 +++++++++ api/v3/examples/EntityTag/Delete.php | 3 +- api/v3/examples/EntityTag/Get.php | 3 +- .../examples/Event/ContactRefCustomField.php | 109 ++++++++++++ api/v3/examples/Event/Create.php | 6 +- api/v3/examples/Event/Delete.php | 3 +- api/v3/examples/Event/Get.php | 8 +- api/v3/examples/Event/IsCurrentOption.php | 6 +- api/v3/examples/Event/IsFullOption.php | 10 +- api/v3/examples/Grant/Create.php | 3 +- api/v3/examples/Grant/Delete.php | 5 +- api/v3/examples/Grant/Get.php | 3 +- api/v3/examples/Group/Get.php | 9 +- api/v3/examples/Group/GetFields.php | 36 +++- api/v3/examples/GroupContact/Create.php | 3 +- api/v3/examples/GroupContact/Delete.php | 3 +- api/v3/examples/GroupContact/Get.php | 3 +- .../examples/GroupContact/GetWithGroupID.php | 9 +- api/v3/examples/GroupNesting/Create.php | 3 +- api/v3/examples/GroupNesting/Delete.php | 3 +- api/v3/examples/GroupNesting/Get.php | 3 +- api/v3/examples/GroupOrganization/Create.php | 3 +- api/v3/examples/GroupOrganization/Delete.php | 3 +- api/v3/examples/GroupOrganization/Get.php | 3 +- api/v3/examples/Im/Create.php | 3 +- api/v3/examples/Im/Delete.php | 5 +- api/v3/examples/Im/Get.php | 3 +- api/v3/examples/Job/Create.php | 3 +- api/v3/examples/Job/Delete.php | 3 +- api/v3/examples/LineItem/Create.php | 5 +- api/v3/examples/LineItem/Delete.php | 3 +- api/v3/examples/LineItem/Get.php | 6 +- api/v3/examples/LocBlock/Create.php | 3 +- api/v3/examples/LocBlock/CreateEntities.php | 3 +- api/v3/examples/LocBlock/Get.php | 3 +- api/v3/examples/Logging/Get.php | 3 +- api/v3/examples/Logging/Revert.php | 3 +- .../MailSettings/ChainedGetDelete.php | 3 +- api/v3/examples/MailSettings/Create.php | 3 +- api/v3/examples/MailSettings/Delete.php | 3 +- api/v3/examples/MailSettings/Get.php | 3 +- api/v3/examples/MailSettings/GetOptions.php | 3 +- api/v3/examples/Mailing/Clone.php | 118 +++++++++++++ api/v3/examples/Mailing/Create.php | 9 +- api/v3/examples/Mailing/Delete.php | 5 +- api/v3/examples/Mailing/GetTokens.php | 3 +- api/v3/examples/Mailing/Submit.php | 3 +- api/v3/examples/MailingAB/Create.php | 3 +- .../examples/MailingEventSubscribe/Create.php | 81 +++++++++ api/v3/examples/Mapping/Create.php | 80 +++++++++ api/v3/examples/Mapping/Delete.php | 70 ++++++++ api/v3/examples/Mapping/Get.php | 80 +++++++++ api/v3/examples/MappingField/Create.php | 92 ++++++++++ api/v3/examples/MappingField/Delete.php | 70 ++++++++ api/v3/examples/MappingField/Get.php | 84 +++++++++ api/v3/examples/Membership/Create.php | 3 +- .../Membership/CreateWithCustomData.php | 3 +- api/v3/examples/Membership/Delete.php | 6 +- .../examples/Membership/FilterIsCurrent.php | 3 +- api/v3/examples/Membership/Get.php | 3 +- .../Membership/SearchWithCustomData.php | 96 +++++++++++ .../examples/Membership/UpdateCustomData.php | 3 +- api/v3/examples/MembershipPayment/Create.php | 3 +- api/v3/examples/MembershipPayment/Get.php | 3 +- api/v3/examples/MembershipStatus/Create.php | 3 +- api/v3/examples/MembershipStatus/Get.php | 3 +- api/v3/examples/MembershipType/Create.php | 5 +- api/v3/examples/MembershipType/Delete.php | 5 +- api/v3/examples/MembershipType/Get.php | 3 +- api/v3/examples/MessageTemplate/Create.php | 3 +- api/v3/examples/MessageTemplate/Delete.php | 5 +- api/v3/examples/MessageTemplate/Get.php | 3 +- api/v3/examples/Note/Create.php | 3 +- api/v3/examples/Note/Delete.php | 3 +- api/v3/examples/Note/Get.php | 3 +- api/v3/examples/OpenID/Create.php | 82 +++++++++ api/v3/examples/OpenID/Delete.php | 70 ++++++++ api/v3/examples/OpenID/Get.php | 82 +++++++++ api/v3/examples/OptionGroup/Create.php | 3 +- api/v3/examples/OptionGroup/Delete.php | 5 +- api/v3/examples/OptionGroup/Get.php | 3 +- api/v3/examples/OptionValue/Get.php | 8 +- api/v3/examples/OptionValue/SortOption.php | 4 +- api/v3/examples/Order/Cancel.php | 4 +- api/v3/examples/Order/Create.php | 4 +- .../examples/Order/CreateOrderParticipant.php | 6 +- api/v3/examples/Order/Delete.php | 3 +- api/v3/examples/Order/Get.php | 3 +- api/v3/examples/Participant/Create.php | 4 +- api/v3/examples/Participant/Get.php | 3 +- api/v3/examples/Participant/NestedDelete.php | 3 +- .../examples/Participant/NestedEventGet.php | 6 +- api/v3/examples/ParticipantPayment/Create.php | 3 +- api/v3/examples/ParticipantPayment/Delete.php | 3 +- api/v3/examples/ParticipantPayment/Get.php | 3 +- .../examples/ParticipantStatusType/Create.php | 3 +- .../examples/ParticipantStatusType/Delete.php | 3 +- api/v3/examples/ParticipantStatusType/Get.php | 3 +- api/v3/examples/PaymentProcessor/Create.php | 3 +- api/v3/examples/Phone/GetOptions.php | 3 +- tests/phpunit/api/v3/ContributionPageTest.php | 10 +- tests/phpunit/api/v3/ContributionTest.php | 10 +- tests/phpunit/api/v3/FinancialTypeACLTest.php | 18 +- 181 files changed, 2131 insertions(+), 258 deletions(-) create mode 100644 api/v3/examples/CaseContact/Get.php create mode 100644 api/v3/examples/EntityBatch/Create.php create mode 100644 api/v3/examples/EntityBatch/Delete.php create mode 100644 api/v3/examples/EntityBatch/Get.php create mode 100644 api/v3/examples/Event/ContactRefCustomField.php create mode 100644 api/v3/examples/Mailing/Clone.php create mode 100644 api/v3/examples/MailingEventSubscribe/Create.php create mode 100644 api/v3/examples/Mapping/Create.php create mode 100644 api/v3/examples/Mapping/Delete.php create mode 100644 api/v3/examples/Mapping/Get.php create mode 100644 api/v3/examples/MappingField/Create.php create mode 100644 api/v3/examples/MappingField/Delete.php create mode 100644 api/v3/examples/MappingField/Get.php create mode 100644 api/v3/examples/Membership/SearchWithCustomData.php create mode 100644 api/v3/examples/OpenID/Create.php create mode 100644 api/v3/examples/OpenID/Delete.php create mode 100644 api/v3/examples/OpenID/Get.php diff --git a/api/v3/examples/Activity/ContactRefCustomField.php b/api/v3/examples/Activity/ContactRefCustomField.php index 6d9fba5541..adf4230f13 100644 --- a/api/v3/examples/Activity/ContactRefCustomField.php +++ b/api/v3/examples/Activity/ContactRefCustomField.php @@ -30,7 +30,8 @@ function activity_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -78,6 +79,7 @@ function activity_create_expectedresult() { 'campaign_id' => '', 'engagement_level' => '', 'weight' => '', + 'is_star' => '', ), ), ); diff --git a/api/v3/examples/Activity/ContactRefCustomFieldGet.php b/api/v3/examples/Activity/ContactRefCustomFieldGet.php index ec99659ff6..6cd8188ccb 100644 --- a/api/v3/examples/Activity/ContactRefCustomFieldGet.php +++ b/api/v3/examples/Activity/ContactRefCustomFieldGet.php @@ -22,7 +22,8 @@ function activity_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Activity/Create.php b/api/v3/examples/Activity/Create.php index eacee7ed30..6615362918 100644 --- a/api/v3/examples/Activity/Create.php +++ b/api/v3/examples/Activity/Create.php @@ -28,7 +28,8 @@ function activity_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Activity/DateTimeHigh.php b/api/v3/examples/Activity/DateTimeHigh.php index 2c9a0b4c3e..4833a1885b 100644 --- a/api/v3/examples/Activity/DateTimeHigh.php +++ b/api/v3/examples/Activity/DateTimeHigh.php @@ -23,7 +23,8 @@ function activity_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -60,6 +61,7 @@ function activity_get_expectedresult() { 'is_auto' => 0, 'is_current_revision' => '1', 'is_deleted' => 0, + 'is_star' => 0, 'source_contact_id' => '1', ), ), diff --git a/api/v3/examples/Activity/DateTimeLow.php b/api/v3/examples/Activity/DateTimeLow.php index eeb99152c9..f7052bc2aa 100644 --- a/api/v3/examples/Activity/DateTimeLow.php +++ b/api/v3/examples/Activity/DateTimeLow.php @@ -22,7 +22,8 @@ function activity_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -59,6 +60,7 @@ function activity_get_expectedresult() { 'is_auto' => 0, 'is_current_revision' => '1', 'is_deleted' => 0, + 'is_star' => 0, 'source_contact_id' => '1', ), ), diff --git a/api/v3/examples/Activity/Delete.php b/api/v3/examples/Activity/Delete.php index f8c5be72ba..f2e9bbfa57 100644 --- a/api/v3/examples/Activity/Delete.php +++ b/api/v3/examples/Activity/Delete.php @@ -19,7 +19,8 @@ function activity_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Activity/Get.php b/api/v3/examples/Activity/Get.php index 343a07b19d..ac52fab260 100644 --- a/api/v3/examples/Activity/Get.php +++ b/api/v3/examples/Activity/Get.php @@ -22,7 +22,8 @@ function activity_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Activity/GetFields.php b/api/v3/examples/Activity/GetFields.php index 746daa6e40..a6269d125a 100644 --- a/api/v3/examples/Activity/GetFields.php +++ b/api/v3/examples/Activity/GetFields.php @@ -19,7 +19,8 @@ function activity_getfields_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -39,17 +40,19 @@ function activity_getfields_expectedresult() { $expectedResult = array( 'is_error' => 0, 'version' => 3, - 'count' => 27, + 'count' => 29, 'values' => array( 'source_record_id' => array( 'name' => 'source_record_id', 'type' => 1, 'title' => 'Source Record', + 'description' => 'Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.', ), 'activity_type_id' => array( 'name' => 'activity_type_id', 'type' => 1, 'title' => 'Activity Type ID', + 'description' => 'FK to civicrm_option_value.id, that has to be valid, registered activity type.', 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_activity.activity_type_id', @@ -58,15 +61,19 @@ function activity_getfields_expectedresult() { 'default' => '1', 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'activity_type', + 'optionEditPath' => 'civicrm/admin/options/activity_type', ), ), 'activity_date_time' => array( 'name' => 'activity_date_time', 'type' => 12, 'title' => 'Activity Date', + 'description' => 'Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.', 'import' => TRUE, 'where' => 'civicrm_activity.activity_date_time', 'headerPattern' => '/(activity.)?date(.time$)?/i', @@ -79,9 +86,12 @@ function activity_getfields_expectedresult() { 'name' => 'phone_id', 'type' => 1, 'title' => 'Phone (called) ID', + 'description' => 'Phone ID of the number called (optional - used if an existing phone number is selected).', 'FKClassName' => 'CRM_Core_DAO_Phone', 'html' => array( - 'type' => 'Autocomplete-Select', + 'type' => 'EntityRef', + 'size' => 6, + 'maxlength' => 14, ), 'FKApiName' => 'Phone', ), @@ -89,27 +99,35 @@ function activity_getfields_expectedresult() { 'name' => 'phone_number', 'type' => 2, 'title' => 'Phone (called) Number', + 'description' => 'Phone number in case the number does not exist in the civicrm_phone table.', 'maxlength' => 64, 'size' => 30, 'html' => array( 'type' => 'Text', + 'maxlength' => 64, + 'size' => 30, ), ), 'priority_id' => array( 'name' => 'priority_id', 'type' => 1, 'title' => 'Priority', + 'description' => 'ID of the priority given to this activity. Foreign key to civicrm_option_value.', 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'priority', + 'optionEditPath' => 'civicrm/admin/options/priority', ), ), 'parent_id' => array( 'name' => 'parent_id', 'type' => 1, 'title' => 'Parent Activity Id', + 'description' => 'Parent meeting ID (if this is a follow-up item). This is not currently implemented', 'FKClassName' => 'CRM_Activity_DAO_Activity', 'FKApiName' => 'Activity', ), @@ -122,6 +140,7 @@ function activity_getfields_expectedresult() { 'name' => 'relationship_id', 'type' => 1, 'title' => 'Relationship Id', + 'description' => 'FK to Relationship ID', 'default' => 'NULL', 'FKClassName' => 'CRM_Contact_DAO_Relationship', 'FKApiName' => 'Relationship', @@ -143,6 +162,7 @@ function activity_getfields_expectedresult() { 'name' => 'original_id', 'type' => 1, 'title' => 'Original Activity ID ', + 'description' => 'Activity ID of the first activity record in versioning chain.', 'FKClassName' => 'CRM_Activity_DAO_Activity', 'FKApiName' => 'Activity', ), @@ -152,12 +172,25 @@ function activity_getfields_expectedresult() { 'title' => 'Order', 'html' => array( 'type' => 'Text', + 'size' => 6, + 'maxlength' => 14, ), ), + 'is_star' => array( + 'name' => 'is_star', + 'type' => 16, + 'title' => 'Is Starred', + 'description' => 'Activity marked as favorite.', + 'import' => TRUE, + 'where' => 'civicrm_activity.is_star', + 'headerPattern' => '/(activity.)?(star|favorite)/i', + 'export' => TRUE, + ), 'id' => array( 'name' => 'id', 'type' => 1, 'title' => 'Activity ID', + 'description' => 'Unique Other Activity ID', 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_activity.id', @@ -171,6 +204,7 @@ function activity_getfields_expectedresult() { 'name' => 'subject', 'type' => 2, 'title' => 'Subject', + 'description' => 'The subject/purpose/short description of the activity.', 'maxlength' => 255, 'size' => 45, 'import' => TRUE, @@ -179,6 +213,8 @@ function activity_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), 'uniqueName' => 'activity_subject', ), @@ -186,12 +222,15 @@ function activity_getfields_expectedresult() { 'name' => 'duration', 'type' => 1, 'title' => 'Duration', + 'description' => 'Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.', 'import' => TRUE, 'where' => 'civicrm_activity.duration', 'headerPattern' => '/(activity.)?duration(s)?$/i', 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'size' => 6, + 'maxlength' => 14, ), 'uniqueName' => 'activity_duration', ), @@ -199,6 +238,7 @@ function activity_getfields_expectedresult() { 'name' => 'location', 'type' => 2, 'title' => 'Location', + 'description' => 'Location of the activity (optional, open text).', 'maxlength' => 255, 'size' => 45, 'import' => TRUE, @@ -207,6 +247,8 @@ function activity_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), 'uniqueName' => 'activity_location', ), @@ -214,14 +256,15 @@ function activity_getfields_expectedresult() { 'name' => 'details', 'type' => 32, 'title' => 'Details', - 'rows' => 8, - 'cols' => 60, + 'description' => 'Details about the activity (agenda, notes, etc).', 'import' => TRUE, 'where' => 'civicrm_activity.details', 'headerPattern' => '/(activity.)?detail(s)?$/i', 'export' => TRUE, 'html' => array( 'type' => 'RichTextEditor', + 'rows' => 2, + 'cols' => 80, ), 'uniqueName' => 'activity_details', ), @@ -229,14 +272,18 @@ function activity_getfields_expectedresult() { 'name' => 'status_id', 'type' => 1, 'title' => 'Activity Status', + 'description' => 'ID of the status this activity is currently in. Foreign key to civicrm_option_value.', 'import' => TRUE, 'where' => 'civicrm_activity.status_id', 'headerPattern' => '/(activity.)?status(.label$)?/i', 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'activity_status', + 'optionEditPath' => 'civicrm/admin/options/activity_status', ), 'uniqueName' => 'activity_status_id', 'api.aliases' => array( @@ -260,12 +307,16 @@ function activity_getfields_expectedresult() { 'name' => 'medium_id', 'type' => 1, 'title' => 'Activity Medium', + 'description' => 'Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.', 'default' => 'NULL', 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'encounter_medium', + 'optionEditPath' => 'civicrm/admin/options/encounter_medium', ), 'uniqueName' => 'activity_medium_id', ), @@ -273,10 +324,13 @@ function activity_getfields_expectedresult() { 'name' => 'result', 'type' => 2, 'title' => 'Result', + 'description' => 'Currently being used to store result id for survey activity, FK to option value.', 'maxlength' => 255, 'size' => 45, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), 'uniqueName' => 'activity_result', ), @@ -297,12 +351,15 @@ function activity_getfields_expectedresult() { 'name' => 'campaign_id', 'type' => 1, 'title' => 'Campaign', + 'description' => 'The campaign for which this activity has been triggered.', 'import' => TRUE, 'where' => 'civicrm_activity.campaign_id', 'export' => TRUE, 'FKClassName' => 'CRM_Campaign_DAO_Campaign', 'html' => array( 'type' => 'CheckBox', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'table' => 'civicrm_campaign', @@ -316,35 +373,53 @@ function activity_getfields_expectedresult() { 'name' => 'engagement_level', 'type' => 1, 'title' => 'Engagement Index', + 'description' => 'Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.', 'import' => TRUE, 'where' => 'civicrm_activity.engagement_level', 'export' => TRUE, 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'engagement_index', + 'optionEditPath' => 'civicrm/admin/options/engagement_index', ), 'uniqueName' => 'activity_engagement_level', ), 'source_contact_id' => array( 'name' => 'source_contact_id', 'title' => 'Activity Source Contact', + 'description' => 'Person who created this activity. Defaults to current user.', 'type' => 1, - 'FKClassName' => 'CRM_Activity_DAO_ActivityContact', + 'FKClassName' => 'CRM_Contact_DAO_Contact', 'api.default' => 'user_contact_id', + 'FKApiName' => 'Contact', ), 'assignee_contact_id' => array( 'name' => 'assignee_id', - 'title' => 'assigned to', + 'title' => 'Activity Assignee', + 'description' => 'Contact(s) assigned to this activity.', 'type' => 1, - 'FKClassName' => 'CRM_Activity_DAO_ActivityContact', + 'FKClassName' => 'CRM_Contact_DAO_Contact', + 'FKApiName' => 'Contact', ), 'target_contact_id' => array( 'name' => 'target_id', 'title' => 'Activity Target', + 'description' => 'Contact(s) participating in this activity.', + 'type' => 1, + 'FKClassName' => 'CRM_Contact_DAO_Contact', + 'FKApiName' => 'Contact', + ), + 'case_id' => array( + 'name' => 'case_id', + 'title' => 'Case ID', + 'description' => 'For creating an activity as part of a case.', 'type' => 1, - 'FKClassName' => 'CRM_Activity_DAO_ActivityContact', + 'FKClassName' => 'CRM_Case_DAO_Case', + 'FKApiName' => 'Case', ), ), ); diff --git a/api/v3/examples/Activity/GetTargetandAssignee.php b/api/v3/examples/Activity/GetTargetandAssignee.php index 924922bb68..c225c8d38e 100644 --- a/api/v3/examples/Activity/GetTargetandAssignee.php +++ b/api/v3/examples/Activity/GetTargetandAssignee.php @@ -31,7 +31,8 @@ function activity_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -79,6 +80,7 @@ function activity_create_expectedresult() { 'campaign_id' => '', 'engagement_level' => '', 'weight' => '', + 'is_star' => '', ), ), ); diff --git a/api/v3/examples/Activity/GetTargetandAssigneeName.php b/api/v3/examples/Activity/GetTargetandAssigneeName.php index 8601802533..77b45f7bbb 100644 --- a/api/v3/examples/Activity/GetTargetandAssigneeName.php +++ b/api/v3/examples/Activity/GetTargetandAssigneeName.php @@ -11,10 +11,10 @@ function activity_getsingle_example() { $params = array( 'id' => 1, 'return' => array( - 'subject', - 'source_contact_name', - 'target_contact_name', - 'assignee_contact_name', + '0' => 'source_contact_name', + '1' => 'target_contact_name', + '2' => 'assignee_contact_name', + '3' => 'subject', ), ); diff --git a/api/v3/examples/Activity/ReturnAssigneeContact.php b/api/v3/examples/Activity/ReturnAssigneeContact.php index 545793076c..574a34a7b2 100644 --- a/api/v3/examples/Activity/ReturnAssigneeContact.php +++ b/api/v3/examples/Activity/ReturnAssigneeContact.php @@ -26,7 +26,8 @@ function activity_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -63,6 +64,7 @@ function activity_get_expectedresult() { 'is_auto' => 0, 'is_current_revision' => '1', 'is_deleted' => 0, + 'is_star' => 0, 'assignee_contact_id' => array( '0' => '3', ), diff --git a/api/v3/examples/ActivityContact/Create.php b/api/v3/examples/ActivityContact/Create.php index 5a0a7cb64a..f01e72a521 100644 --- a/api/v3/examples/ActivityContact/Create.php +++ b/api/v3/examples/ActivityContact/Create.php @@ -21,7 +21,8 @@ function activity_contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ActivityContact/Delete.php b/api/v3/examples/ActivityContact/Delete.php index 7920498221..d627dcac85 100644 --- a/api/v3/examples/ActivityContact/Delete.php +++ b/api/v3/examples/ActivityContact/Delete.php @@ -19,7 +19,8 @@ function activity_contact_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ActivityType/Create.php b/api/v3/examples/ActivityType/Create.php index 3fb68a21a6..ac5da5ced8 100644 --- a/api/v3/examples/ActivityType/Create.php +++ b/api/v3/examples/ActivityType/Create.php @@ -27,7 +27,8 @@ function activity_type_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ActivityType/Get.php b/api/v3/examples/ActivityType/Get.php index b6e93f75a9..a2158500c1 100644 --- a/api/v3/examples/ActivityType/Get.php +++ b/api/v3/examples/ActivityType/Get.php @@ -20,7 +20,8 @@ function activity_type_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -63,7 +64,7 @@ function activity_type_get_expectedresult() { '19' => 'Bulk Email', '20' => 'Assign Case Role', '21' => 'Remove Case Role', - '22' => 'Print PDF Letter', + '22' => 'Print/Merge Document', '23' => 'Merge Case', '24' => 'Reassigned Case', '25' => 'Link Cases', @@ -92,6 +93,10 @@ function activity_type_get_expectedresult() { '48' => 'Change Registration', '49' => 'Downloaded Invoice', '50' => 'Emailed Invoice', + '51' => 'Contact Merged', + '52' => 'Contact Deleted by Merge', + '53' => 'Failed Payment', + '54' => 'Close Accounting Period', ), 'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.', ); diff --git a/api/v3/examples/Address/AddressLike.php b/api/v3/examples/Address/AddressLike.php index 87d490a69b..74d0da4545 100644 --- a/api/v3/examples/Address/AddressLike.php +++ b/api/v3/examples/Address/AddressLike.php @@ -24,7 +24,8 @@ function address_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Address/AddressParse.php b/api/v3/examples/Address/AddressParse.php index 4fb7dabc7c..329f7c071d 100644 --- a/api/v3/examples/Address/AddressParse.php +++ b/api/v3/examples/Address/AddressParse.php @@ -24,7 +24,8 @@ function address_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Address/AddressSort.php b/api/v3/examples/Address/AddressSort.php index f8f82481d3..de36d5b903 100644 --- a/api/v3/examples/Address/AddressSort.php +++ b/api/v3/examples/Address/AddressSort.php @@ -25,7 +25,8 @@ function address_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Address/Create.php b/api/v3/examples/Address/Create.php index 222a81ca50..cabd73c7be 100644 --- a/api/v3/examples/Address/Create.php +++ b/api/v3/examples/Address/Create.php @@ -27,7 +27,8 @@ function address_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Address/Delete.php b/api/v3/examples/Address/Delete.php index 993b11f91f..09e5867669 100644 --- a/api/v3/examples/Address/Delete.php +++ b/api/v3/examples/Address/Delete.php @@ -19,7 +19,8 @@ function address_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function address_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/Address/Get.php b/api/v3/examples/Address/Get.php index a06342e144..f19315e085 100644 --- a/api/v3/examples/Address/Get.php +++ b/api/v3/examples/Address/Get.php @@ -20,7 +20,8 @@ function address_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Address/GetOptions.php b/api/v3/examples/Address/GetOptions.php index cfa88f4052..436b1e475a 100644 --- a/api/v3/examples/Address/GetOptions.php +++ b/api/v3/examples/Address/GetOptions.php @@ -19,7 +19,8 @@ function address_getoptions_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Batch/Create.php b/api/v3/examples/Batch/Create.php index c5d8f447af..6b4c9f1991 100644 --- a/api/v3/examples/Batch/Create.php +++ b/api/v3/examples/Batch/Create.php @@ -24,7 +24,8 @@ function batch_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Batch/Delete.php b/api/v3/examples/Batch/Delete.php index b97d5573b6..bed04ab9bd 100644 --- a/api/v3/examples/Batch/Delete.php +++ b/api/v3/examples/Batch/Delete.php @@ -19,7 +19,8 @@ function batch_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Batch/Get.php b/api/v3/examples/Batch/Get.php index a0548bcaac..9deff39a48 100644 --- a/api/v3/examples/Batch/Get.php +++ b/api/v3/examples/Batch/Get.php @@ -19,7 +19,8 @@ function batch_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Campaign/Create.php b/api/v3/examples/Campaign/Create.php index ce04e6da89..86f1df29d1 100644 --- a/api/v3/examples/Campaign/Create.php +++ b/api/v3/examples/Campaign/Create.php @@ -24,7 +24,8 @@ function campaign_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Campaign/Delete.php b/api/v3/examples/Campaign/Delete.php index cff0043eb3..d6b5fd5eae 100644 --- a/api/v3/examples/Campaign/Delete.php +++ b/api/v3/examples/Campaign/Delete.php @@ -19,7 +19,8 @@ function campaign_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function campaign_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/Campaign/Get.php b/api/v3/examples/Campaign/Get.php index bfb051e1ba..afad3b080a 100644 --- a/api/v3/examples/Campaign/Get.php +++ b/api/v3/examples/Campaign/Get.php @@ -21,7 +21,8 @@ function campaign_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Case/Create.php b/api/v3/examples/Case/Create.php index 6bdab33e37..bfffed40bb 100644 --- a/api/v3/examples/Case/Create.php +++ b/api/v3/examples/Case/Create.php @@ -21,7 +21,8 @@ function case_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/CaseContact/Get.php b/api/v3/examples/CaseContact/Get.php new file mode 100644 index 0000000000..b4070df73a --- /dev/null +++ b/api/v3/examples/CaseContact/Get.php @@ -0,0 +1,77 @@ + 19, + ); + + try{ + $result = civicrm_api3('CaseContact', 'get', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function case_contact_get_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 2, + 'values' => array( + '2' => array( + 'id' => '2', + 'case_id' => '2', + 'contact_id' => '19', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testCaseContactGet" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CaseContactTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Constant/Get.php b/api/v3/examples/Constant/Get.php index 8655d1aad7..a6c11087a0 100644 --- a/api/v3/examples/Constant/Get.php +++ b/api/v3/examples/Constant/Get.php @@ -22,7 +22,8 @@ function constant_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -58,7 +59,7 @@ function constant_get_expectedresult() { '12' => 'Inbound Email', '17' => 'Membership Renewal Reminder', '19' => 'Bulk Email', - '22' => 'Print PDF Letter', + '22' => 'Print/Merge Document', '34' => 'Mass SMS', '35' => 'Change Membership Status', '36' => 'Change Membership Type', @@ -76,6 +77,10 @@ function constant_get_expectedresult() { '48' => 'Change Registration', '49' => 'Downloaded Invoice', '50' => 'Emailed Invoice', + '51' => 'Contact Merged', + '52' => 'Contact Deleted by Merge', + '53' => 'Failed Payment', + '54' => 'Close Accounting Period', ), 'deprecated' => 'The Constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.', ); diff --git a/api/v3/examples/Contact/APIChainedArray.php b/api/v3/examples/Contact/APIChainedArray.php index fe8e67a331..839b99005e 100644 --- a/api/v3/examples/Contact/APIChainedArray.php +++ b/api/v3/examples/Contact/APIChainedArray.php @@ -28,7 +28,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/APIChainedArrayFormats.php b/api/v3/examples/Contact/APIChainedArrayFormats.php index 38792cba7c..c79c27a426 100644 --- a/api/v3/examples/Contact/APIChainedArrayFormats.php +++ b/api/v3/examples/Contact/APIChainedArrayFormats.php @@ -29,7 +29,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/APIChainedArrayMultipleCustom.php b/api/v3/examples/Contact/APIChainedArrayMultipleCustom.php index 92ca2e0a00..c484a896c6 100644 --- a/api/v3/examples/Contact/APIChainedArrayMultipleCustom.php +++ b/api/v3/examples/Contact/APIChainedArrayMultipleCustom.php @@ -26,7 +26,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php b/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php index 55a690da31..a1b3a68db3 100644 --- a/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php +++ b/api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php @@ -31,7 +31,8 @@ function contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -66,7 +67,7 @@ function contact_create_expectedresult() { 'is_opt_out' => 0, 'legal_identifier' => '', 'external_identifier' => '', - 'sort_name' => '', + 'sort_name' => 'batman', 'display_name' => 'batman', 'nick_name' => '', 'legal_name' => '', diff --git a/api/v3/examples/Contact/ChainTwoWebsites.php b/api/v3/examples/Contact/ChainTwoWebsites.php index e2153adfd5..8d2a4d3ff5 100644 --- a/api/v3/examples/Contact/ChainTwoWebsites.php +++ b/api/v3/examples/Contact/ChainTwoWebsites.php @@ -43,7 +43,8 @@ function contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -151,6 +152,7 @@ function contact_create_expectedresult() { 'campaign_id' => '', 'creditnote_id' => '', 'tax_amount' => '', + 'revenue_recognition_date' => '', 'contribution_type_id' => '1', ), ), diff --git a/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php b/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php index f17f204a2c..99e6a75588 100644 --- a/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php +++ b/api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php @@ -46,7 +46,8 @@ function contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -154,6 +155,7 @@ function contact_create_expectedresult() { 'campaign_id' => '', 'creditnote_id' => '', 'tax_amount' => '', + 'revenue_recognition_date' => '', 'contribution_type_id' => '1', ), ), diff --git a/api/v3/examples/Contact/Create.php b/api/v3/examples/Contact/Create.php index 5720faef55..9e0392a4dc 100644 --- a/api/v3/examples/Contact/Create.php +++ b/api/v3/examples/Contact/Create.php @@ -24,7 +24,8 @@ function contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/CustomFieldGet.php b/api/v3/examples/Contact/CustomFieldGet.php index 6dc057cffd..ac3e7b3ab6 100644 --- a/api/v3/examples/Contact/CustomFieldGet.php +++ b/api/v3/examples/Contact/CustomFieldGet.php @@ -22,7 +22,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php b/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php index 3e2ac2ee3a..d5ac755842 100644 --- a/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php +++ b/api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php @@ -22,7 +22,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/Delete.php b/api/v3/examples/Contact/Delete.php index 47571b5dda..bfb4f9976e 100644 --- a/api/v3/examples/Contact/Delete.php +++ b/api/v3/examples/Contact/Delete.php @@ -19,7 +19,8 @@ function contact_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/FormatIsSuccess_Fail.php b/api/v3/examples/Contact/FormatIsSuccess_Fail.php index 6f342d00ed..add6872f4b 100644 --- a/api/v3/examples/Contact/FormatIsSuccess_Fail.php +++ b/api/v3/examples/Contact/FormatIsSuccess_Fail.php @@ -23,7 +23,8 @@ function contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/FormatIsSuccess_True.php b/api/v3/examples/Contact/FormatIsSuccess_True.php index 09a9febca0..9f46af903f 100644 --- a/api/v3/examples/Contact/FormatIsSuccess_True.php +++ b/api/v3/examples/Contact/FormatIsSuccess_True.php @@ -23,7 +23,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/FormatOnlyID.php b/api/v3/examples/Contact/FormatOnlyID.php index fa74cbafd6..e208faeddb 100644 --- a/api/v3/examples/Contact/FormatOnlyID.php +++ b/api/v3/examples/Contact/FormatOnlyID.php @@ -24,7 +24,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/FormatSingleValue.php b/api/v3/examples/Contact/FormatSingleValue.php index 5dea481117..49d52becc1 100644 --- a/api/v3/examples/Contact/FormatSingleValue.php +++ b/api/v3/examples/Contact/FormatSingleValue.php @@ -24,7 +24,8 @@ function contact_getvalue_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/Get.php b/api/v3/examples/Contact/Get.php index 79be6cea47..fb2556c9f4 100644 --- a/api/v3/examples/Contact/Get.php +++ b/api/v3/examples/Contact/Get.php @@ -19,7 +19,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/GetActions.php b/api/v3/examples/Contact/GetActions.php index 12012f6949..d2c85713ed 100644 --- a/api/v3/examples/Contact/GetActions.php +++ b/api/v3/examples/Contact/GetActions.php @@ -19,7 +19,8 @@ function contact_getactions_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -39,31 +40,33 @@ function contact_getactions_expectedresult() { $expectedResult = array( 'is_error' => 0, 'version' => 3, - 'count' => 23, + 'count' => 25, 'values' => array( '0' => 'create', '1' => 'delete', - '2' => 'example_action1', - '3' => 'example_action2', - '4' => 'get', - '5' => 'getactions', - '6' => 'getcount', - '7' => 'getfields', - '8' => 'getlist', - '9' => 'getoptions', - '10' => 'getquick', - '11' => 'getrefcount', - '12' => 'getsingle', - '13' => 'getstat', - '14' => 'getvalue', - '15' => 'merge', - '16' => 'proximity', - '17' => 'replace', - '18' => 'setvalue', - '19' => 'type_create', - '20' => 'type_delete', - '21' => 'type_get', - '22' => 'update', + '2' => 'duplicatecheck', + '3' => 'example_action1', + '4' => 'example_action2', + '5' => 'get', + '6' => 'getactions', + '7' => 'getcount', + '8' => 'getfield', + '9' => 'getfields', + '10' => 'getlist', + '11' => 'getoptions', + '12' => 'getquick', + '13' => 'getrefcount', + '14' => 'getsingle', + '15' => 'getvalue', + '16' => 'merge', + '17' => 'proximity', + '18' => 'replace', + '19' => 'setvalue', + '20' => 'type_create', + '21' => 'type_delete', + '22' => 'type_get', + '23' => 'update', + '24' => 'validate', ), 'deprecated' => array( 'getquick' => 'The "getquick" action is deprecated in favor of "getlist".', diff --git a/api/v3/examples/Contact/GetCountContact.php b/api/v3/examples/Contact/GetCountContact.php index 724616b3e5..7a775e80f2 100644 --- a/api/v3/examples/Contact/GetCountContact.php +++ b/api/v3/examples/Contact/GetCountContact.php @@ -22,7 +22,8 @@ function contact_getcount_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/GetFieldsOptions.php b/api/v3/examples/Contact/GetFieldsOptions.php index 2b10ae16bf..a366b40958 100644 --- a/api/v3/examples/Contact/GetFieldsOptions.php +++ b/api/v3/examples/Contact/GetFieldsOptions.php @@ -24,7 +24,8 @@ function contact_getfields_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -49,7 +50,8 @@ function contact_getfields_expectedresult() { 'id' => array( 'name' => 'id', 'type' => 1, - 'title' => 'Internal Contact ID', + 'title' => 'Contact ID', + 'description' => 'Unique Contact ID', 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_contact.id', @@ -63,12 +65,15 @@ function contact_getfields_expectedresult() { 'name' => 'contact_type', 'type' => 2, 'title' => 'Contact Type', + 'description' => 'Type of Contact.', 'maxlength' => 64, 'size' => 30, 'export' => TRUE, 'where' => 'civicrm_contact.contact_type', 'html' => array( 'type' => 'Select', + 'maxlength' => 64, + 'size' => 30, ), 'pseudoconstant' => array( 'table' => 'civicrm_contact_type', @@ -82,6 +87,7 @@ function contact_getfields_expectedresult() { 'name' => 'contact_sub_type', 'type' => 2, 'title' => 'Contact Subtype', + 'description' => 'May be used to over-ride contact view and edit templates.', 'maxlength' => 255, 'size' => 45, 'import' => TRUE, @@ -89,7 +95,9 @@ function contact_getfields_expectedresult() { 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i', 'export' => TRUE, 'html' => array( - 'type' => 'Multi-Select', + 'type' => 'Select', + 'maxlength' => 255, + 'size' => 45, ), 'pseudoconstant' => array( 'table' => 'civicrm_contact_type', @@ -167,6 +175,7 @@ function contact_getfields_expectedresult() { 'name' => 'is_opt_out', 'type' => 16, 'title' => 'No Bulk Emails (User Opt Out)', + 'description' => 'Has the contact opted out from receiving all bulk email from the organization or site domain?', 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_contact.is_opt_out', @@ -179,6 +188,8 @@ function contact_getfields_expectedresult() { 'name' => 'legal_identifier', 'type' => 2, 'title' => 'Legal Identifier', + 'description' => 'May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID. + ', 'maxlength' => 32, 'size' => 20, 'import' => TRUE, @@ -188,12 +199,15 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 32, + 'size' => 20, ), ), 'external_identifier' => array( 'name' => 'external_identifier', 'type' => 2, 'title' => 'External Identifier', + 'description' => 'Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.', 'maxlength' => 64, 'size' => 8, 'import' => TRUE, @@ -203,36 +217,45 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 64, + 'size' => 8, ), ), 'sort_name' => array( 'name' => 'sort_name', 'type' => 2, 'title' => 'Sort Name', + 'description' => 'Name used for sorting different contact types', 'maxlength' => 128, 'size' => 30, 'export' => TRUE, 'where' => 'civicrm_contact.sort_name', 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 30, ), ), 'display_name' => array( 'name' => 'display_name', 'type' => 2, 'title' => 'Display Name', + 'description' => 'Formatted name representing preferred format for display/print/other output.', 'maxlength' => 128, 'size' => 30, 'export' => TRUE, 'where' => 'civicrm_contact.display_name', 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 30, ), ), 'nick_name' => array( 'name' => 'nick_name', 'type' => 2, 'title' => 'Nickname', + 'description' => 'Nickname.', 'maxlength' => 128, 'size' => 30, 'import' => TRUE, @@ -242,12 +265,15 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 30, ), ), 'legal_name' => array( 'name' => 'legal_name', 'type' => 2, 'title' => 'Legal Name', + 'description' => 'Legal Name.', 'maxlength' => 128, 'size' => 30, 'import' => TRUE, @@ -256,25 +282,29 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 30, ), ), 'image_URL' => array( 'name' => 'image_URL', - 'type' => 2, + 'type' => 32, 'title' => 'Image Url', - 'maxlength' => 255, - 'size' => 45, + 'description' => 'optional URL for preferred image (photo, logo, etc.) to display for this contact.', 'import' => TRUE, 'where' => 'civicrm_contact.image_URL', 'export' => TRUE, 'html' => array( - 'type' => 'Text', + 'type' => 'File', + 'rows' => 2, + 'cols' => 80, ), ), 'preferred_communication_method' => array( 'name' => 'preferred_communication_method', 'type' => 2, 'title' => 'Preferred Communication Method', + 'description' => 'What is the preferred mode of communication.', 'maxlength' => 255, 'size' => 45, 'import' => TRUE, @@ -284,15 +314,19 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Select', + 'maxlength' => 255, + 'size' => 45, ), 'pseudoconstant' => array( 'optionGroupName' => 'preferred_communication_method', + 'optionEditPath' => 'civicrm/admin/options/preferred_communication_method', ), ), 'preferred_language' => array( 'name' => 'preferred_language', 'type' => 2, 'title' => 'Preferred Language', + 'description' => 'Which language is preferred for communication. FK to languages in civicrm_option_value.', 'maxlength' => 5, 'size' => 6, 'import' => TRUE, @@ -301,16 +335,20 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Select', + 'maxlength' => 5, + 'size' => 6, ), 'pseudoconstant' => array( 'optionGroupName' => 'languages', 'keyColumn' => 'name', + 'optionEditPath' => 'civicrm/admin/options/languages', ), ), 'preferred_mail_format' => array( 'name' => 'preferred_mail_format', 'type' => 2, 'title' => 'Preferred Mail Format', + 'description' => 'What is the preferred mode of sending an email.', 'maxlength' => 8, 'size' => 8, 'import' => TRUE, @@ -320,6 +358,8 @@ function contact_getfields_expectedresult() { 'default' => 'Both', 'html' => array( 'type' => 'Select', + 'maxlength' => 8, + 'size' => 8, ), 'pseudoconstant' => array( 'callback' => 'CRM_Core_SelectValues::pmf', @@ -329,6 +369,7 @@ function contact_getfields_expectedresult() { 'name' => 'hash', 'type' => 2, 'title' => 'Contact Hash', + 'description' => 'Key for validating requests related to this contact.', 'maxlength' => 32, 'size' => 20, 'export' => TRUE, @@ -338,6 +379,7 @@ function contact_getfields_expectedresult() { 'name' => 'api_key', 'type' => 2, 'title' => 'Api Key', + 'description' => 'API Key for validating requests related to this contact.', 'maxlength' => 32, 'size' => 20, ), @@ -345,6 +387,7 @@ function contact_getfields_expectedresult() { 'name' => 'first_name', 'type' => 2, 'title' => 'First Name', + 'description' => 'First Name.', 'maxlength' => 64, 'size' => 30, 'import' => TRUE, @@ -354,14 +397,17 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 64, + 'size' => 30, ), ), 'middle_name' => array( 'name' => 'middle_name', 'type' => 2, 'title' => 'Middle Name', + 'description' => 'Middle Name.', 'maxlength' => 64, - 'size' => 20, + 'size' => 30, 'import' => TRUE, 'where' => 'civicrm_contact.middle_name', 'headerPattern' => '/^middle|(m(iddle\\s)?name)$/i', @@ -369,12 +415,15 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 64, + 'size' => 30, ), ), 'last_name' => array( 'name' => 'last_name', 'type' => 2, 'title' => 'Last Name', + 'description' => 'Last Name.', 'maxlength' => 64, 'size' => 30, 'import' => TRUE, @@ -384,12 +433,15 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 64, + 'size' => 30, ), ), 'prefix_id' => array( 'name' => 'prefix_id', 'type' => 1, 'title' => 'Individual Prefix', + 'description' => 'Prefix or Title for name (Ms, Mr...). FK to prefix ID', 'import' => TRUE, 'where' => 'civicrm_contact.prefix_id', 'headerPattern' => '/^(prefix|title)/i', @@ -397,9 +449,12 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'individual_prefix', + 'optionEditPath' => 'civicrm/admin/options/individual_prefix', ), 'api.aliases' => array( '0' => 'individual_prefix', @@ -410,6 +465,7 @@ function contact_getfields_expectedresult() { 'name' => 'suffix_id', 'type' => 1, 'title' => 'Individual Suffix', + 'description' => 'Suffix for name (Jr, Sr...). FK to suffix ID', 'import' => TRUE, 'where' => 'civicrm_contact.suffix_id', 'headerPattern' => '/^suffix$/i', @@ -417,9 +473,12 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'individual_suffix', + 'optionEditPath' => 'civicrm/admin/options/individual_suffix', ), 'api.aliases' => array( '0' => 'individual_suffix', @@ -430,113 +489,150 @@ function contact_getfields_expectedresult() { 'name' => 'formal_title', 'type' => 2, 'title' => 'Formal Title', + 'description' => 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)', 'maxlength' => 64, 'size' => 30, 'import' => TRUE, 'where' => 'civicrm_contact.formal_title', 'headerPattern' => '/^title/i', 'export' => TRUE, + 'html' => array( + 'type' => 'Text', + 'maxlength' => 64, + 'size' => 30, + ), ), 'communication_style_id' => array( 'name' => 'communication_style_id', 'type' => 1, 'title' => 'Communication Style', + 'description' => 'Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.', 'export' => TRUE, 'where' => 'civicrm_contact.communication_style_id', + 'html' => array( + 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, + ), 'pseudoconstant' => array( 'optionGroupName' => 'communication_style', + 'optionEditPath' => 'civicrm/admin/options/communication_style', ), ), 'email_greeting_id' => array( 'name' => 'email_greeting_id', 'type' => 1, 'title' => 'Email Greeting ID', + 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Email Greeting.', ), 'email_greeting_custom' => array( 'name' => 'email_greeting_custom', 'type' => 2, 'title' => 'Email Greeting Custom', + 'description' => 'Custom Email Greeting.', 'maxlength' => 128, 'size' => 45, 'import' => TRUE, 'where' => 'civicrm_contact.email_greeting_custom', 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 45, ), ), 'email_greeting_display' => array( 'name' => 'email_greeting_display', 'type' => 2, 'title' => 'Email Greeting', + 'description' => 'Cache Email Greeting.', 'maxlength' => 255, 'size' => 45, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), ), 'postal_greeting_id' => array( 'name' => 'postal_greeting_id', 'type' => 1, 'title' => 'Postal Greeting ID', + 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.', 'html' => array( 'type' => 'Text', + 'size' => 6, + 'maxlength' => 14, ), ), 'postal_greeting_custom' => array( 'name' => 'postal_greeting_custom', 'type' => 2, 'title' => 'Postal Greeting Custom', + 'description' => 'Custom Postal greeting.', 'maxlength' => 128, 'size' => 45, 'import' => TRUE, 'where' => 'civicrm_contact.postal_greeting_custom', 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 45, ), ), 'postal_greeting_display' => array( 'name' => 'postal_greeting_display', 'type' => 2, 'title' => 'Postal Greeting', + 'description' => 'Cache Postal greeting.', 'maxlength' => 255, 'size' => 45, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), ), 'addressee_id' => array( 'name' => 'addressee_id', 'type' => 1, 'title' => 'Addressee ID', + 'description' => 'FK to civicrm_option_value.id, that has to be valid registered Addressee.', ), 'addressee_custom' => array( 'name' => 'addressee_custom', 'type' => 2, 'title' => 'Addressee Custom', + 'description' => 'Custom Addressee.', 'maxlength' => 128, 'size' => 45, 'import' => TRUE, 'where' => 'civicrm_contact.addressee_custom', 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 45, ), ), 'addressee_display' => array( 'name' => 'addressee_display', 'type' => 2, 'title' => 'Addressee', + 'description' => 'Cache Addressee.', 'maxlength' => 255, 'size' => 45, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), ), 'job_title' => array( 'name' => 'job_title', 'type' => 2, 'title' => 'Job Title', + 'description' => 'Job Title', 'maxlength' => 255, - 'size' => 20, + 'size' => 30, 'import' => TRUE, 'where' => 'civicrm_contact.job_title', 'headerPattern' => '/^job|(j(ob\\s)?title)$/i', @@ -544,27 +640,37 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 30, ), ), 'gender_id' => array( 'name' => 'gender_id', 'type' => 1, 'title' => 'Gender', + 'description' => 'FK to gender ID', 'import' => TRUE, 'where' => 'civicrm_contact.gender_id', 'headerPattern' => '/^gender$/i', 'export' => TRUE, 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'pseudoconstant' => array( 'optionGroupName' => 'gender', + 'optionEditPath' => 'civicrm/admin/options/gender', + ), + 'api.aliases' => array( + '0' => 'gender', ), ), 'birth_date' => array( 'name' => 'birth_date', 'type' => 4, 'title' => 'Birth Date', + 'description' => 'Date of birth', 'import' => TRUE, 'where' => 'civicrm_contact.birth_date', 'headerPattern' => '/^birth|(b(irth\\s)?date)|D(\\W*)O(\\W*)B(\\W*)$/i', @@ -590,6 +696,7 @@ function contact_getfields_expectedresult() { 'name' => 'deceased_date', 'type' => 4, 'title' => 'Deceased Date', + 'description' => 'Date of deceased', 'import' => TRUE, 'where' => 'civicrm_contact.deceased_date', 'headerPattern' => '/^deceased|(d(eceased\\s)?date)$/i', @@ -602,6 +709,7 @@ function contact_getfields_expectedresult() { 'name' => 'household_name', 'type' => 2, 'title' => 'Household Name', + 'description' => 'Household Name.', 'maxlength' => 128, 'size' => 30, 'import' => TRUE, @@ -611,15 +719,20 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 30, ), ), 'primary_contact_id' => array( 'name' => 'primary_contact_id', 'type' => 1, 'title' => 'Household Primary Contact ID', + 'description' => 'Optional FK to Primary Contact for this household.', 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => array( 'type' => 'Select', + 'size' => 6, + 'maxlength' => 14, ), 'FKApiName' => 'Contact', ), @@ -627,6 +740,7 @@ function contact_getfields_expectedresult() { 'name' => 'organization_name', 'type' => 2, 'title' => 'Organization Name', + 'description' => 'Organization Name.', 'maxlength' => 128, 'size' => 30, 'import' => TRUE, @@ -636,12 +750,15 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 128, + 'size' => 30, ), ), 'sic_code' => array( 'name' => 'sic_code', 'type' => 2, 'title' => 'Sic Code', + 'description' => 'Standard Industry Classification Code.', 'maxlength' => 8, 'size' => 8, 'import' => TRUE, @@ -650,12 +767,15 @@ function contact_getfields_expectedresult() { 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 8, + 'size' => 8, ), ), 'user_unique_id' => array( 'name' => 'user_unique_id', 'type' => 2, 'title' => 'Unique ID (OpenID)', + 'description' => 'the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM', 'maxlength' => 255, 'size' => 45, 'import' => TRUE, @@ -666,12 +786,15 @@ function contact_getfields_expectedresult() { 'rule' => 'url', 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 45, ), ), 'created_date' => array( 'name' => 'created_date', 'type' => 256, 'title' => 'Created Date', + 'description' => 'When was the contact was created.', 'required' => '', 'export' => TRUE, 'where' => 'civicrm_contact.created_date', @@ -681,6 +804,7 @@ function contact_getfields_expectedresult() { 'name' => 'modified_date', 'type' => 256, 'title' => 'Modified Date', + 'description' => 'When was the contact (or closely related entity) was created or modified or deleted.', 'required' => '', 'export' => TRUE, 'where' => 'civicrm_contact.modified_date', @@ -690,26 +814,32 @@ function contact_getfields_expectedresult() { 'name' => 'source', 'type' => 2, 'title' => 'Contact Source', + 'description' => 'where contact come from, e.g. import, donate module insert...', 'maxlength' => 255, 'size' => 30, 'import' => TRUE, 'where' => 'civicrm_contact.source', - 'headerPattern' => '/(S(ource\\s)?o(f\\s)?C(ontact\\s)?Data)$/i', + 'headerPattern' => '/(C(ontact\\s)?Source)$/i', 'export' => TRUE, 'html' => array( 'type' => 'Text', + 'maxlength' => 255, + 'size' => 30, ), 'uniqueName' => 'contact_source', ), 'employer_id' => array( 'name' => 'employer_id', 'type' => 1, - 'title' => 'Current Employer ID', + 'title' => 'Current Employer', + 'description' => 'OPTIONAL FK to civicrm_contact record.', 'export' => TRUE, 'where' => 'civicrm_contact.employer_id', 'FKClassName' => 'CRM_Contact_DAO_Contact', 'html' => array( - 'type' => 'Autocomplete-Select', + 'type' => 'EntityRef', + 'size' => 6, + 'maxlength' => 14, ), 'uniqueName' => 'current_employer_id', 'FKApiName' => 'Contact', @@ -741,10 +871,16 @@ function contact_getfields_expectedresult() { 'extends_entity_column_id' => '', 'is_view' => 0, 'is_multiple' => 0, - 'option_group_id' => '106', + 'option_group_id' => '105', 'date_format' => '', 'time_format' => '', 'is_required' => '1', + 'table_name' => 'civicrm_value_select_test_g_1', + 'column_name' => 'our_special_field_1', + 'pseudoconstant' => array( + 'optionGroupName' => 'our_special_field_20170124082923', + 'optionEditPath' => 'civicrm/admin/options/our_special_field_20170124082923', + ), 'name' => 'custom_1', 'title' => 'Our special field', 'type' => 2, @@ -762,6 +898,7 @@ function contact_getfields_expectedresult() { 'dupe_check' => array( 'title' => 'Check for Duplicates', 'description' => 'Throw error if contact create matches dedupe rule', + 'type' => 16, 'name' => 'dupe_check', ), ), diff --git a/api/v3/examples/Contact/GetOptions.php b/api/v3/examples/Contact/GetOptions.php index f485f5a400..454f7a78aa 100644 --- a/api/v3/examples/Contact/GetOptions.php +++ b/api/v3/examples/Contact/GetOptions.php @@ -21,7 +21,8 @@ function contact_getoptions_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/GetSingleContact.php b/api/v3/examples/Contact/GetSingleContact.php index 1c202ab54e..8df5d1e5af 100644 --- a/api/v3/examples/Contact/GetSingleContact.php +++ b/api/v3/examples/Contact/GetSingleContact.php @@ -23,7 +23,8 @@ function contact_getsingle_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/GroupFilterUsingContactAPI.php b/api/v3/examples/Contact/GroupFilterUsingContactAPI.php index f821db1fc0..67fadede7a 100644 --- a/api/v3/examples/Contact/GroupFilterUsingContactAPI.php +++ b/api/v3/examples/Contact/GroupFilterUsingContactAPI.php @@ -25,7 +25,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Contact/NestedReplaceEmail.php b/api/v3/examples/Contact/NestedReplaceEmail.php index 549c40bd52..47d9fb29d1 100644 --- a/api/v3/examples/Contact/NestedReplaceEmail.php +++ b/api/v3/examples/Contact/NestedReplaceEmail.php @@ -50,7 +50,8 @@ function contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionPage/Create.php b/api/v3/examples/ContributionPage/Create.php index 3da279757f..bff46b83de 100644 --- a/api/v3/examples/ContributionPage/Create.php +++ b/api/v3/examples/ContributionPage/Create.php @@ -24,7 +24,8 @@ function contribution_page_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -60,6 +61,7 @@ function contribution_page_create_expectedresult() { 'recur_frequency_unit' => '', 'is_recur_interval' => '', 'is_recur_installments' => '', + 'adjust_recur_start_date' => '', 'is_pay_later' => '1', 'pay_later_text' => '', 'pay_later_receipt' => '', diff --git a/api/v3/examples/ContributionPage/Delete.php b/api/v3/examples/ContributionPage/Delete.php index d151e916c9..b0ffc33052 100644 --- a/api/v3/examples/ContributionPage/Delete.php +++ b/api/v3/examples/ContributionPage/Delete.php @@ -19,7 +19,8 @@ function contribution_page_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionPage/Get.php b/api/v3/examples/ContributionPage/Get.php index fb11aac0f5..cc7cd888b2 100644 --- a/api/v3/examples/ContributionPage/Get.php +++ b/api/v3/examples/ContributionPage/Get.php @@ -21,7 +21,8 @@ function contribution_page_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionPage/Submit.php b/api/v3/examples/ContributionPage/Submit.php index c26b197384..db56853f5d 100644 --- a/api/v3/examples/ContributionPage/Submit.php +++ b/api/v3/examples/ContributionPage/Submit.php @@ -41,7 +41,8 @@ function contribution_page_submit_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionRecur/Create.php b/api/v3/examples/ContributionRecur/Create.php index be1c268558..fdfac34b8d 100644 --- a/api/v3/examples/ContributionRecur/Create.php +++ b/api/v3/examples/ContributionRecur/Create.php @@ -26,7 +26,8 @@ function contribution_recur_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -59,10 +60,11 @@ function contribution_recur_create_expectedresult() { 'installments' => '12', 'start_date' => '2013-07-29 00:00:00', 'create_date' => '20120130621222105', - 'modified_date' => '', + 'modified_date' => '2012-11-14 16:02:35', 'cancel_date' => '', 'end_date' => '', 'processor_id' => '', + 'payment_token_id' => '', 'trxn_id' => '', 'invoice_id' => '', 'contribution_status_id' => '1', diff --git a/api/v3/examples/ContributionRecur/Delete.php b/api/v3/examples/ContributionRecur/Delete.php index 8721098765..f5b732f6f0 100644 --- a/api/v3/examples/ContributionRecur/Delete.php +++ b/api/v3/examples/ContributionRecur/Delete.php @@ -19,7 +19,8 @@ function contribution_recur_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionRecur/Get.php b/api/v3/examples/ContributionRecur/Get.php index df8b9ff1a0..44defa9ace 100644 --- a/api/v3/examples/ContributionRecur/Get.php +++ b/api/v3/examples/ContributionRecur/Get.php @@ -19,7 +19,8 @@ function contribution_recur_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -52,6 +53,7 @@ function contribution_recur_get_expectedresult() { 'installments' => '12', 'start_date' => '2013-07-29 00:00:00', 'create_date' => '20120130621222105', + 'modified_date' => '2012-11-14 16:02:35', 'contribution_status_id' => '1', 'is_test' => 0, 'cycle_day' => '1', diff --git a/api/v3/examples/ContributionSoft/Create.php b/api/v3/examples/ContributionSoft/Create.php index d88953f94f..8450990dfc 100644 --- a/api/v3/examples/ContributionSoft/Create.php +++ b/api/v3/examples/ContributionSoft/Create.php @@ -23,7 +23,8 @@ function contribution_soft_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionSoft/Delete.php b/api/v3/examples/ContributionSoft/Delete.php index 64dd7b371b..0a6ccc5508 100644 --- a/api/v3/examples/ContributionSoft/Delete.php +++ b/api/v3/examples/ContributionSoft/Delete.php @@ -19,7 +19,8 @@ function contribution_soft_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ContributionSoft/Get.php b/api/v3/examples/ContributionSoft/Get.php index 1cf28d1bf1..91f49635fa 100644 --- a/api/v3/examples/ContributionSoft/Get.php +++ b/api/v3/examples/ContributionSoft/Get.php @@ -19,7 +19,8 @@ function contribution_soft_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Country/Create.php b/api/v3/examples/Country/Create.php index eb9feefeae..091baaa5ef 100644 --- a/api/v3/examples/Country/Create.php +++ b/api/v3/examples/Country/Create.php @@ -21,7 +21,8 @@ function country_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Country/Delete.php b/api/v3/examples/Country/Delete.php index 5482903bb8..a631c34a07 100644 --- a/api/v3/examples/Country/Delete.php +++ b/api/v3/examples/Country/Delete.php @@ -19,7 +19,8 @@ function country_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Country/Get.php b/api/v3/examples/Country/Get.php index 5b72473981..d1cf00f99c 100644 --- a/api/v3/examples/Country/Get.php +++ b/api/v3/examples/Country/Get.php @@ -19,7 +19,8 @@ function country_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/CustomField/Create.php b/api/v3/examples/CustomField/Create.php index 3e98f5c8b0..5316d37f61 100644 --- a/api/v3/examples/CustomField/Create.php +++ b/api/v3/examples/CustomField/Create.php @@ -28,7 +28,8 @@ function custom_field_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/CustomField/Delete.php b/api/v3/examples/CustomField/Delete.php index df553d6929..ed130904d7 100644 --- a/api/v3/examples/CustomField/Delete.php +++ b/api/v3/examples/CustomField/Delete.php @@ -19,7 +19,8 @@ function custom_field_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/CustomGroup/Create.php b/api/v3/examples/CustomGroup/Create.php index fe3b7e950d..5a29551feb 100644 --- a/api/v3/examples/CustomGroup/Create.php +++ b/api/v3/examples/CustomGroup/Create.php @@ -29,7 +29,8 @@ function custom_group_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/CustomGroup/Delete.php b/api/v3/examples/CustomGroup/Delete.php index 429be45180..db517f083f 100644 --- a/api/v3/examples/CustomGroup/Delete.php +++ b/api/v3/examples/CustomGroup/Delete.php @@ -19,7 +19,8 @@ function custom_group_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/CustomGroup/Get.php b/api/v3/examples/CustomGroup/Get.php index 6477dd985f..3a8a90a800 100644 --- a/api/v3/examples/CustomGroup/Get.php +++ b/api/v3/examples/CustomGroup/Get.php @@ -17,7 +17,8 @@ function custom_group_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Domain/Create.php b/api/v3/examples/Domain/Create.php index 0ab3c81451..71fc08495c 100644 --- a/api/v3/examples/Domain/Create.php +++ b/api/v3/examples/Domain/Create.php @@ -22,7 +22,8 @@ function domain_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -50,10 +51,10 @@ function domain_create_expectedresult() { 'name' => 'A-team domain', 'description' => 'domain of chaos', 'config_backend' => '', - 'version' => '4.2', 'contact_id' => '6', 'locales' => '', 'locale_custom_strings' => '', + 'domain_version' => '4.2', ), ), ); diff --git a/api/v3/examples/Domain/Get.php b/api/v3/examples/Domain/Get.php index f1f753f57d..00aca938d5 100644 --- a/api/v3/examples/Domain/Get.php +++ b/api/v3/examples/Domain/Get.php @@ -19,7 +19,8 @@ function domain_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -44,8 +45,7 @@ function domain_get_expectedresult() { '0' => array( 'id' => '1', 'name' => 'Default Domain Name', - 'config_backend' => 'a:82:{s:18:\"fatalErrorTemplate\";s:20:\"CRM/common/fatal.tpl\";s:15:\"civiRelativeURL\";s:13:\"/index.php?q=\";s:11:\"civiVersion\";s:10:\"4.6.alpha7\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";b:0;s:19:\"supports_UF_Logging\";b:0;s:24:\"supports_form_extensions\";b:0;}s:11:\"initialized\";i:0;s:15:\"DAOFactoryClass\";s:23:\"CRM_Contact_DAO_Factory\";s:17:\"componentRegistry\";O:18:\"CRM_Core_Component\":0:{}s:9:\"inCiviCRM\";b:0;s:18:\"recaptchaPublicKey\";N;s:5:\"debug\";i:0;s:9:\"backtrace\";i:0;s:12:\"resourceBase\";N;s:13:\"extensionsURL\";N;s:12:\"countryLimit\";a:1:{i:0;s:4:\"1228\";}s:27:\"defaultContactStateProvince\";N;s:13:\"provinceLimit\";a:1:{i:0;s:4:\"1228\";}s:21:\"defaultContactCountry\";s:4:\"1228\";s:15:\"defaultCurrency\";s:3:\"USD\";s:10:\"lcMessages\";s:5:\"en_US\";s:18:\"dateformatDatetime\";s:20:\"%B %E%f, %Y %l:%M %P\";s:14:\"dateformatFull\";s:11:\"%B %E%f, %Y\";s:17:\"dateformatPartial\";s:5:\"%B %Y\";s:14:\"dateformatYear\";s:2:\"%Y\";s:14:\"dateformatTime\";s:8:\"%l:%M %P\";s:15:\"timeInputFormat\";i:1;s:15:\"dateInputFormat\";s:8:\"mm/dd/yy\";s:15:\"fiscalYearStart\";a:2:{s:1:\"M\";i:1;s:1:\"d\";i:1;}s:11:\"moneyformat\";s:5:\"%c %a\";s:16:\"moneyvalueformat\";s:3:\"%!i\";s:15:\"currencySymbols\";s:0:\"\";s:21:\"defaultCurrencySymbol\";s:1:\"$\";s:20:\"monetaryDecimalPoint\";s:1:\".\";s:25:\"monetaryThousandSeparator\";s:1:\",\";s:14:\"gettextCodeset\";s:5:\"utf-8\";s:13:\"gettextDomain\";s:7:\"civicrm\";s:27:\"userFrameworkUsersTableName\";s:5:\"users\";s:21:\"userFrameworkFrontend\";b:0;s:20:\"userFrameworkLogging\";b:0;s:17:\"maxImportFileSize\";i:2097152;s:11:\"maxFileSize\";i:2;s:11:\"mapProvider\";N;s:9:\"mapAPIKey\";N;s:11:\"geoProvider\";N;s:9:\"geoAPIKey\";N;s:13:\"geocodeMethod\";s:0:\"\";s:12:\"mapGeoCoding\";i:1;s:7:\"logging\";b:0;s:16:\"enableComponents\";a:6:{i:0;s:14:\"CiviContribute\";i:1;s:10:\"CiviPledge\";i:2;s:10:\"CiviMember\";i:3;s:9:\"CiviEvent\";i:4;s:8:\"CiviMail\";i:5;s:10:\"CiviReport\";}s:18:\"enableComponentIDs\";a:6:{i:0;i:1;i:1;i:6;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:8;}s:9:\"enableSSL\";b:0;s:17:\"fatalErrorHandler\";N;s:14:\"legacyEncoding\";s:12:\"Windows-1252\";s:14:\"fieldSeparator\";s:1:\",\";s:17:\"maxLocationBlocks\";i:2;s:15:\"captchaFontPath\";s:25:\"/usr/X11R6/lib/X11/fonts/\";s:11:\"captchaFont\";s:17:\"HelveticaBold.ttf\";s:21:\"includeWildCardInName\";i:1;s:18:\"includeEmailInName\";i:1;s:21:\"includeNickNameInName\";i:0;s:22:\"smartGroupCacheTimeout\";i:5;s:22:\"defaultSearchProfileID\";N;s:21:\"dashboardCacheTimeout\";i:1440;s:15:\"doNotResetCache\";i:0;s:24:\"includeAlphabeticalPager\";i:1;s:20:\"includeOrderByClause\";i:1;s:13:\"oldInputStyle\";i:1;s:14:\"formKeyDisable\";b:0;s:21:\"doNotAttachPDFReceipt\";b:0;s:15:\"wkhtmltopdfPath\";b:0;s:23:\"secondDegRelPermissions\";b:0;s:10:\"wpBasePage\";N;s:9:\"groupTree\";b:0;s:11:\"revampPages\";a:0:{}s:13:\"verpSeparator\";s:1:\".\";s:12:\"mailerPeriod\";i:180;s:16:\"mailerSpoolLimit\";i:0;s:16:\"mailerBatchLimit\";i:0;s:13:\"mailerJobSize\";i:0;s:13:\"mailerJobsMax\";i:0;s:16:\"mailThrottleTime\";i:0;s:12:\"customCSSURL\";N;}', - 'version' => '3', + 'version' => '4.6.alpha1', 'contact_id' => '3', 'locale_custom_strings' => 'a:1:{s:5:\"en_US\";a:0:{}}', 'domain_email' => 'my@email.com', @@ -66,11 +66,11 @@ function domain_get_expectedresult() { ), 'from_email' => 'info@EXAMPLE.ORG', 'from_name' => 'FIXME', + 'domain_version' => '4.6.alpha1', ), '1' => array( 'id' => '2', 'name' => 'Second Domain', - 'config_backend' => 'a:82:{s:18:\"fatalErrorTemplate\";s:20:\"CRM/common/fatal.tpl\";s:15:\"civiRelativeURL\";s:13:\"/index.php?q=\";s:11:\"civiVersion\";s:10:\"4.6.alpha7\";s:11:\"empoweredBy\";b:1;s:10:\"userSystem\";O:26:\"CRM_Utils_System_UnitTests\":5:{s:9:\"is_drupal\";b:0;s:9:\"is_joomla\";b:0;s:12:\"is_wordpress\";b:0;s:19:\"supports_UF_Logging\";b:0;s:24:\"supports_form_extensions\";b:0;}s:11:\"initialized\";i:0;s:15:\"DAOFactoryClass\";s:23:\"CRM_Contact_DAO_Factory\";s:17:\"componentRegistry\";O:18:\"CRM_Core_Component\":0:{}s:9:\"inCiviCRM\";b:0;s:18:\"recaptchaPublicKey\";N;s:5:\"debug\";i:0;s:9:\"backtrace\";i:0;s:12:\"resourceBase\";N;s:13:\"extensionsURL\";N;s:12:\"countryLimit\";a:1:{i:0;s:4:\"1228\";}s:27:\"defaultContactStateProvince\";N;s:13:\"provinceLimit\";a:1:{i:0;s:4:\"1228\";}s:21:\"defaultContactCountry\";s:4:\"1228\";s:15:\"defaultCurrency\";s:3:\"USD\";s:10:\"lcMessages\";s:5:\"en_US\";s:18:\"dateformatDatetime\";s:20:\"%B %E%f, %Y %l:%M %P\";s:14:\"dateformatFull\";s:11:\"%B %E%f, %Y\";s:17:\"dateformatPartial\";s:5:\"%B %Y\";s:14:\"dateformatYear\";s:2:\"%Y\";s:14:\"dateformatTime\";s:8:\"%l:%M %P\";s:15:\"timeInputFormat\";i:1;s:15:\"dateInputFormat\";s:8:\"mm/dd/yy\";s:15:\"fiscalYearStart\";a:2:{s:1:\"M\";i:1;s:1:\"d\";i:1;}s:11:\"moneyformat\";s:5:\"%c %a\";s:16:\"moneyvalueformat\";s:3:\"%!i\";s:15:\"currencySymbols\";s:0:\"\";s:21:\"defaultCurrencySymbol\";s:1:\"$\";s:20:\"monetaryDecimalPoint\";s:1:\".\";s:25:\"monetaryThousandSeparator\";s:1:\",\";s:14:\"gettextCodeset\";s:5:\"utf-8\";s:13:\"gettextDomain\";s:7:\"civicrm\";s:27:\"userFrameworkUsersTableName\";s:5:\"users\";s:21:\"userFrameworkFrontend\";b:0;s:20:\"userFrameworkLogging\";b:0;s:17:\"maxImportFileSize\";i:2097152;s:11:\"maxFileSize\";i:2;s:11:\"mapProvider\";N;s:9:\"mapAPIKey\";N;s:11:\"geoProvider\";N;s:9:\"geoAPIKey\";N;s:13:\"geocodeMethod\";s:0:\"\";s:12:\"mapGeoCoding\";i:1;s:7:\"logging\";b:0;s:16:\"enableComponents\";a:6:{i:0;s:14:\"CiviContribute\";i:1;s:10:\"CiviPledge\";i:2;s:10:\"CiviMember\";i:3;s:9:\"CiviEvent\";i:4;s:8:\"CiviMail\";i:5;s:10:\"CiviReport\";}s:18:\"enableComponentIDs\";a:6:{i:0;i:1;i:1;i:6;i:2;i:2;i:3;i:3;i:4;i:4;i:5;i:8;}s:9:\"enableSSL\";b:0;s:17:\"fatalErrorHandler\";N;s:14:\"legacyEncoding\";s:12:\"Windows-1252\";s:14:\"fieldSeparator\";s:1:\",\";s:17:\"maxLocationBlocks\";i:2;s:15:\"captchaFontPath\";s:25:\"/usr/X11R6/lib/X11/fonts/\";s:11:\"captchaFont\";s:17:\"HelveticaBold.ttf\";s:21:\"includeWildCardInName\";i:1;s:18:\"includeEmailInName\";i:1;s:21:\"includeNickNameInName\";i:0;s:22:\"smartGroupCacheTimeout\";i:5;s:22:\"defaultSearchProfileID\";N;s:21:\"dashboardCacheTimeout\";i:1440;s:15:\"doNotResetCache\";i:0;s:24:\"includeAlphabeticalPager\";i:1;s:20:\"includeOrderByClause\";i:1;s:13:\"oldInputStyle\";i:1;s:14:\"formKeyDisable\";b:0;s:21:\"doNotAttachPDFReceipt\";b:0;s:15:\"wkhtmltopdfPath\";b:0;s:23:\"secondDegRelPermissions\";b:0;s:10:\"wpBasePage\";N;s:9:\"groupTree\";b:0;s:11:\"revampPages\";a:0:{}s:13:\"verpSeparator\";s:1:\".\";s:12:\"mailerPeriod\";i:180;s:16:\"mailerSpoolLimit\";i:0;s:16:\"mailerBatchLimit\";i:0;s:13:\"mailerJobSize\";i:0;s:13:\"mailerJobsMax\";i:0;s:16:\"mailThrottleTime\";i:0;s:12:\"customCSSURL\";N;}', 'version' => '4.6.alpha1', 'contact_id' => '2', 'domain_email' => '\"Domain Email\" ', @@ -91,6 +91,7 @@ function domain_get_expectedresult() { ), 'from_email' => 'info@EXAMPLE.ORG', 'from_name' => 'FIXME', + 'domain_version' => '4.6.alpha1', ), ), ); diff --git a/api/v3/examples/Email/Create.php b/api/v3/examples/Email/Create.php index 71e56b9ab4..aa7b3f24e7 100644 --- a/api/v3/examples/Email/Create.php +++ b/api/v3/examples/Email/Create.php @@ -22,7 +22,8 @@ function email_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Email/Delete.php b/api/v3/examples/Email/Delete.php index 2c2b3e2b58..fa65dd94ae 100644 --- a/api/v3/examples/Email/Delete.php +++ b/api/v3/examples/Email/Delete.php @@ -19,7 +19,8 @@ function email_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function email_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/Email/Replace.php b/api/v3/examples/Email/Replace.php index 74654ade26..650709d46f 100644 --- a/api/v3/examples/Email/Replace.php +++ b/api/v3/examples/Email/Replace.php @@ -46,7 +46,8 @@ function email_replace_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/EntityBatch/Create.php b/api/v3/examples/EntityBatch/Create.php new file mode 100644 index 0000000000..85486c61e0 --- /dev/null +++ b/api/v3/examples/EntityBatch/Create.php @@ -0,0 +1,80 @@ + 1, + 'batch_id' => 1, + 'entity_table' => 'civicrm_financial_trxn', + ); + + try{ + $result = civicrm_api3('EntityBatch', 'create', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function entity_batch_create_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'id' => '1', + 'entity_table' => 'civicrm_financial_trxn', + 'entity_id' => '1', + 'batch_id' => '1', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testCreateEntityBatch" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityBatchTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/EntityBatch/Delete.php b/api/v3/examples/EntityBatch/Delete.php new file mode 100644 index 0000000000..ed94376e3f --- /dev/null +++ b/api/v3/examples/EntityBatch/Delete.php @@ -0,0 +1,70 @@ + 3, + ); + + try{ + $result = civicrm_api3('EntityBatch', 'delete', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function entity_batch_delete_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'values' => 1, + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testDeleteEntityBatch" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityBatchTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/EntityBatch/Get.php b/api/v3/examples/EntityBatch/Get.php new file mode 100644 index 0000000000..d1aa10a3e1 --- /dev/null +++ b/api/v3/examples/EntityBatch/Get.php @@ -0,0 +1,80 @@ + 2, + 'batch_id' => 2, + 'entity_table' => 'civicrm_financial_trxn', + ); + + try{ + $result = civicrm_api3('EntityBatch', 'get', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function entity_batch_get_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 2, + 'values' => array( + '2' => array( + 'id' => '2', + 'entity_table' => 'civicrm_financial_trxn', + 'entity_id' => '2', + 'batch_id' => '2', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testGetEntityBatch" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityBatchTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/EntityTag/Delete.php b/api/v3/examples/EntityTag/Delete.php index faecc36c6d..9d117d4b9b 100644 --- a/api/v3/examples/EntityTag/Delete.php +++ b/api/v3/examples/EntityTag/Delete.php @@ -20,7 +20,8 @@ function entity_tag_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/EntityTag/Get.php b/api/v3/examples/EntityTag/Get.php index aeb2980772..a51e13c015 100644 --- a/api/v3/examples/EntityTag/Get.php +++ b/api/v3/examples/EntityTag/Get.php @@ -19,7 +19,8 @@ function entity_tag_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Event/ContactRefCustomField.php b/api/v3/examples/Event/ContactRefCustomField.php new file mode 100644 index 0000000000..77adb0b8f7 --- /dev/null +++ b/api/v3/examples/Event/ContactRefCustomField.php @@ -0,0 +1,109 @@ + 1, + 'custom_2' => 4, + ); + + try{ + $result = civicrm_api3('Event', 'get', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function event_get_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 3, + 'values' => array( + '3' => array( + 'id' => '3', + 'title' => 'My test event.', + 'event_title' => 'My test event.', + 'event_description' => '', + 'event_type_id' => '1', + 'participant_listing_id' => 0, + 'is_public' => '1', + 'start_date' => '2013-07-29 00:00:00', + 'event_start_date' => '2013-07-29 00:00:00', + 'event_end_date' => '', + 'is_online_registration' => 0, + 'is_monetary' => 0, + 'is_map' => 0, + 'is_active' => '1', + 'is_show_location' => '1', + 'default_role_id' => '1', + 'is_email_confirm' => 0, + 'is_pay_later' => 0, + 'is_partial_payment' => 0, + 'is_multiple_registrations' => 0, + 'max_additional_participants' => 0, + 'allow_same_participant_emails' => 0, + 'allow_selfcancelxfer' => 0, + 'selfcancelxfer_time' => 0, + 'is_template' => 0, + 'created_date' => '2013-07-28 08:49:19', + 'is_share' => '1', + 'is_confirm_enabled' => '1', + 'is_billing_required' => 0, + 'custom_1' => 'defaultValue', + 'custom_2_id' => '4', + 'custom_2' => 'Contact, Test', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testEventGetCustomContactRefFieldCRM16036" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Event/Create.php b/api/v3/examples/Event/Create.php index 2b0363e88d..d5f0bb942a 100644 --- a/api/v3/examples/Event/Create.php +++ b/api/v3/examples/Event/Create.php @@ -33,7 +33,8 @@ function event_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -105,10 +106,13 @@ function event_create_expectedresult() { 'initial_amount_help_text' => '', 'min_initial_amount' => '', 'is_multiple_registrations' => '', + 'max_additional_participants' => '', 'allow_same_participant_emails' => '', 'has_waitlist' => '', 'requires_approval' => '', 'expiration_time' => '', + 'allow_selfcancelxfer' => '', + 'selfcancelxfer_time' => '', 'waitlist_text' => '', 'approval_req_text' => '', 'is_template' => 0, diff --git a/api/v3/examples/Event/Delete.php b/api/v3/examples/Event/Delete.php index e3706afb64..9f12de13c0 100644 --- a/api/v3/examples/Event/Delete.php +++ b/api/v3/examples/Event/Delete.php @@ -19,7 +19,8 @@ function event_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Event/Get.php b/api/v3/examples/Event/Get.php index 5892efb636..68637fc4c9 100644 --- a/api/v3/examples/Event/Get.php +++ b/api/v3/examples/Event/Get.php @@ -20,7 +20,8 @@ function event_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -47,11 +48,13 @@ function event_get_expectedresult() { 'id' => '1', 'title' => 'Annual CiviCRM meet', 'event_title' => 'Annual CiviCRM meet', + 'event_description' => '', 'event_type_id' => '1', 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2013-07-29 00:00:00', 'event_start_date' => '2013-07-29 00:00:00', + 'event_end_date' => '', 'is_online_registration' => 0, 'is_monetary' => 0, 'is_map' => 0, @@ -62,7 +65,10 @@ function event_get_expectedresult() { 'is_pay_later' => 0, 'is_partial_payment' => 0, 'is_multiple_registrations' => 0, + 'max_additional_participants' => 0, 'allow_same_participant_emails' => 0, + 'allow_selfcancelxfer' => 0, + 'selfcancelxfer_time' => 0, 'is_template' => 0, 'created_date' => '2013-07-28 08:49:19', 'is_share' => '1', diff --git a/api/v3/examples/Event/IsCurrentOption.php b/api/v3/examples/Event/IsCurrentOption.php index 159c6c2852..9d60d43064 100644 --- a/api/v3/examples/Event/IsCurrentOption.php +++ b/api/v3/examples/Event/IsCurrentOption.php @@ -21,7 +21,8 @@ function event_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -72,7 +73,10 @@ function event_get_expectedresult() { 'is_pay_later' => 0, 'is_partial_payment' => 0, 'is_multiple_registrations' => 0, + 'max_additional_participants' => 0, 'allow_same_participant_emails' => 0, + 'allow_selfcancelxfer' => 0, + 'selfcancelxfer_time' => 0, 'is_template' => 0, 'created_date' => '2013-07-28 08:49:19', 'is_share' => '1', diff --git a/api/v3/examples/Event/IsFullOption.php b/api/v3/examples/Event/IsFullOption.php index 9545de0bd8..0eca96b971 100644 --- a/api/v3/examples/Event/IsFullOption.php +++ b/api/v3/examples/Event/IsFullOption.php @@ -22,7 +22,8 @@ function event_getsingle_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -43,11 +44,13 @@ function event_getsingle_expectedresult() { 'id' => '1', 'title' => 'Annual CiviCRM meet', 'event_title' => 'Annual CiviCRM meet', + 'event_description' => '', 'event_type_id' => '1', 'participant_listing_id' => 0, 'is_public' => '1', 'start_date' => '2008-10-21 00:00:00', 'event_start_date' => '2008-10-21 00:00:00', + 'event_end_date' => '', 'is_online_registration' => 0, 'max_participants' => '1', 'is_monetary' => 0, @@ -59,9 +62,12 @@ function event_getsingle_expectedresult() { 'is_pay_later' => 0, 'is_partial_payment' => 0, 'is_multiple_registrations' => 0, + 'max_additional_participants' => 0, 'allow_same_participant_emails' => 0, + 'allow_selfcancelxfer' => 0, + 'selfcancelxfer_time' => 0, 'is_template' => 0, - 'created_date' => '2015-02-22 23:13:11', + 'created_date' => '2017-01-24 08:34:25', 'is_share' => '1', 'is_confirm_enabled' => '1', 'is_billing_required' => 0, diff --git a/api/v3/examples/Grant/Create.php b/api/v3/examples/Grant/Create.php index 519c097937..f968d9a2a4 100644 --- a/api/v3/examples/Grant/Create.php +++ b/api/v3/examples/Grant/Create.php @@ -26,7 +26,8 @@ function grant_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Grant/Delete.php b/api/v3/examples/Grant/Delete.php index f4323382ed..de116031e3 100644 --- a/api/v3/examples/Grant/Delete.php +++ b/api/v3/examples/Grant/Delete.php @@ -19,7 +19,8 @@ function grant_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function grant_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/Grant/Get.php b/api/v3/examples/Grant/Get.php index ca51ac0660..7892098871 100644 --- a/api/v3/examples/Grant/Get.php +++ b/api/v3/examples/Grant/Get.php @@ -19,7 +19,8 @@ function grant_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Group/Get.php b/api/v3/examples/Group/Get.php index c2137ffa8a..ca31ca89fc 100644 --- a/api/v3/examples/Group/Get.php +++ b/api/v3/examples/Group/Get.php @@ -19,7 +19,8 @@ function group_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -49,9 +50,9 @@ function group_get_expectedresult() { 'description' => 'New Test Group Created', 'is_active' => '1', 'visibility' => 'Public Pages', - 'where_clause' => ' ( `civicrm_group_contact-4`.group_id IN ( 4 ) AND `civicrm_group_contact-4`.status IN (\"Added\") ) ', - 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON ( contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.group_id IN ( 4 ) )\";}', - 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON ( contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.group_id IN ( 4 ) )\";}', + 'where_clause' => ' ( `civicrm_group_contact-4`.group_id IN ( 4 ) ) ', + 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON (contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.status IN (\'Added\'))\";}', + 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-4`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON (contact_a.id = `civicrm_group_contact-4`.contact_id AND `civicrm_group_contact-4`.status IN (\'Added\'))\";}', 'group_type' => array( '0' => '1', '1' => '2', diff --git a/api/v3/examples/Group/GetFields.php b/api/v3/examples/Group/GetFields.php index 5f4962e5e3..22dfe5250c 100644 --- a/api/v3/examples/Group/GetFields.php +++ b/api/v3/examples/Group/GetFields.php @@ -21,7 +21,8 @@ function group_getfields_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -47,6 +48,7 @@ function group_getfields_expectedresult() { 'name' => 'id', 'type' => 1, 'title' => 'Group ID', + 'description' => 'Group ID', 'required' => TRUE, 'api.aliases' => array( '0' => 'group_id', @@ -56,6 +58,7 @@ function group_getfields_expectedresult() { 'name' => 'name', 'type' => 2, 'title' => 'Group Name', + 'description' => 'Internal name of Group.', 'maxlength' => 64, 'size' => 30, ), @@ -63,6 +66,7 @@ function group_getfields_expectedresult() { 'name' => 'title', 'type' => 2, 'title' => 'Group Title', + 'description' => 'Name of Group.', 'maxlength' => 64, 'size' => 30, 'api.required' => 1, @@ -71,16 +75,20 @@ function group_getfields_expectedresult() { 'name' => 'description', 'type' => 32, 'title' => 'Group Description', + 'description' => 'Optional verbose description of the group.', 'rows' => 2, 'cols' => 60, 'html' => array( 'type' => 'TextArea', + 'rows' => 2, + 'cols' => 60, ), ), 'source' => array( 'name' => 'source', 'type' => 2, 'title' => 'Group Source', + 'description' => 'Module or process which created this group.', 'maxlength' => 64, 'size' => 30, ), @@ -88,6 +96,7 @@ function group_getfields_expectedresult() { 'name' => 'saved_search_id', 'type' => 1, 'title' => 'Saved Search ID', + 'description' => 'FK to saved search table.', 'FKClassName' => 'CRM_Contact_DAO_SavedSearch', 'FKApiName' => 'SavedSearch', ), @@ -95,17 +104,21 @@ function group_getfields_expectedresult() { 'name' => 'is_active', 'type' => 16, 'title' => 'Group Enabled', + 'description' => 'Is this entry active?', 'api.default' => 1, ), 'visibility' => array( 'name' => 'visibility', 'type' => 2, 'title' => 'Group Visibility Setting', + 'description' => 'In what context(s) is this field visible.', 'maxlength' => 24, 'size' => 20, 'default' => 'User and User Admin Only', 'html' => array( 'type' => 'Select', + 'maxlength' => 24, + 'size' => 20, ), 'pseudoconstant' => array( 'callback' => 'CRM_Core_SelectValues::groupVisibility', @@ -115,48 +128,63 @@ function group_getfields_expectedresult() { 'name' => 'where_clause', 'type' => 32, 'title' => 'Group Where Clause', + 'description' => 'the sql where clause if a saved search acl', ), 'select_tables' => array( 'name' => 'select_tables', 'type' => 32, 'title' => 'Tables For Select Clause', + 'description' => 'the tables to be included in a select data', ), 'where_tables' => array( 'name' => 'where_tables', 'type' => 32, 'title' => 'Tables For Where Clause', + 'description' => 'the tables to be included in the count statement', ), 'group_type' => array( 'name' => 'group_type', 'type' => 2, 'title' => 'Group Type', + 'description' => 'FK to group type', 'maxlength' => 128, 'size' => 45, + 'pseudoconstant' => array( + 'optionGroupName' => 'group_type', + 'optionEditPath' => 'civicrm/admin/options/group_type', + ), ), 'cache_date' => array( 'name' => 'cache_date', - 'type' => 12, + 'type' => 256, 'title' => 'Group Cache Date', + 'description' => 'Date when we created the cache for a smart group', + 'required' => '', ), 'refresh_date' => array( 'name' => 'refresh_date', - 'type' => 12, + 'type' => 256, 'title' => 'Next Group Refresh Time', + 'description' => 'Date and time when we need to refresh the cache next.', + 'required' => '', ), 'parents' => array( 'name' => 'parents', 'type' => 32, 'title' => 'Group Parents', + 'description' => 'IDs of the parent(s)', ), 'children' => array( 'name' => 'children', 'type' => 32, 'title' => 'Group Children', + 'description' => 'IDs of the child(ren)', ), 'is_hidden' => array( 'name' => 'is_hidden', 'type' => 16, 'title' => 'Group is Hidden', + 'description' => 'Is this group hidden?', ), 'is_reserved' => array( 'name' => 'is_reserved', @@ -167,6 +195,7 @@ function group_getfields_expectedresult() { 'name' => 'created_id', 'type' => 1, 'title' => 'Group Created By', + 'description' => 'FK to contact table.', 'FKClassName' => 'CRM_Contact_DAO_Contact', 'FKApiName' => 'Contact', ), @@ -174,6 +203,7 @@ function group_getfields_expectedresult() { 'name' => 'modified_id', 'type' => 1, 'title' => 'Group Modified By', + 'description' => 'FK to contact table.', 'FKClassName' => 'CRM_Contact_DAO_Contact', 'FKApiName' => 'Contact', ), diff --git a/api/v3/examples/GroupContact/Create.php b/api/v3/examples/GroupContact/Create.php index 6c0b3ec50a..515848316a 100644 --- a/api/v3/examples/GroupContact/Create.php +++ b/api/v3/examples/GroupContact/Create.php @@ -21,7 +21,8 @@ function group_contact_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupContact/Delete.php b/api/v3/examples/GroupContact/Delete.php index cb091b88bb..f0118e15e9 100644 --- a/api/v3/examples/GroupContact/Delete.php +++ b/api/v3/examples/GroupContact/Delete.php @@ -20,7 +20,8 @@ function group_contact_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupContact/Get.php b/api/v3/examples/GroupContact/Get.php index da5d396a50..47511c3dea 100644 --- a/api/v3/examples/GroupContact/Get.php +++ b/api/v3/examples/GroupContact/Get.php @@ -19,7 +19,8 @@ function group_contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupContact/GetWithGroupID.php b/api/v3/examples/GroupContact/GetWithGroupID.php index 304ce81c25..3fa9f14035 100644 --- a/api/v3/examples/GroupContact/GetWithGroupID.php +++ b/api/v3/examples/GroupContact/GetWithGroupID.php @@ -23,7 +23,8 @@ function group_contact_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -64,9 +65,9 @@ function group_contact_get_expectedresult() { 'description' => 'New Test Group Created', 'is_active' => '1', 'visibility' => 'Public Pages', - 'where_clause' => ' ( `civicrm_group_contact-3`.group_id IN ( 3 ) AND `civicrm_group_contact-3`.status IN (\"Added\") ) ', - 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON ( contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.group_id IN ( 3 ) )\";}', - 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON ( contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.group_id IN ( 3 ) )\";}', + 'where_clause' => ' ( `civicrm_group_contact-3`.group_id IN ( 3 ) ) ', + 'select_tables' => 'a:8:{s:15:\"civicrm_contact\";i:1;s:15:\"civicrm_address\";i:1;s:15:\"civicrm_country\";i:1;s:13:\"civicrm_email\";i:1;s:13:\"civicrm_phone\";i:1;s:10:\"civicrm_im\";i:1;s:19:\"civicrm_worldregion\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON (contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.status IN (\'Added\'))\";}', + 'where_tables' => 'a:2:{s:15:\"civicrm_contact\";i:1;s:25:\"`civicrm_group_contact-3`\";s:165:\" LEFT JOIN civicrm_group_contact `civicrm_group_contact-3` ON (contact_a.id = `civicrm_group_contact-3`.contact_id AND `civicrm_group_contact-3`.status IN (\'Added\'))\";}', 'group_type' => array( '0' => '1', '1' => '2', diff --git a/api/v3/examples/GroupNesting/Create.php b/api/v3/examples/GroupNesting/Create.php index cec9d0c507..149dd02864 100644 --- a/api/v3/examples/GroupNesting/Create.php +++ b/api/v3/examples/GroupNesting/Create.php @@ -20,7 +20,8 @@ function group_nesting_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupNesting/Delete.php b/api/v3/examples/GroupNesting/Delete.php index 6868d07231..7a8ab837ae 100644 --- a/api/v3/examples/GroupNesting/Delete.php +++ b/api/v3/examples/GroupNesting/Delete.php @@ -19,7 +19,8 @@ function group_nesting_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupNesting/Get.php b/api/v3/examples/GroupNesting/Get.php index cfb8d6dc3e..3683dad770 100644 --- a/api/v3/examples/GroupNesting/Get.php +++ b/api/v3/examples/GroupNesting/Get.php @@ -20,7 +20,8 @@ function group_nesting_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupOrganization/Create.php b/api/v3/examples/GroupOrganization/Create.php index 445603ea39..4ebee078ed 100644 --- a/api/v3/examples/GroupOrganization/Create.php +++ b/api/v3/examples/GroupOrganization/Create.php @@ -20,7 +20,8 @@ function group_organization_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupOrganization/Delete.php b/api/v3/examples/GroupOrganization/Delete.php index 295faa72d7..ad41dc6cad 100644 --- a/api/v3/examples/GroupOrganization/Delete.php +++ b/api/v3/examples/GroupOrganization/Delete.php @@ -19,7 +19,8 @@ function group_organization_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/GroupOrganization/Get.php b/api/v3/examples/GroupOrganization/Get.php index 94a1edb330..696179d9a7 100644 --- a/api/v3/examples/GroupOrganization/Get.php +++ b/api/v3/examples/GroupOrganization/Get.php @@ -19,7 +19,8 @@ function group_organization_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Im/Create.php b/api/v3/examples/Im/Create.php index e37267c400..440e89a0af 100644 --- a/api/v3/examples/Im/Create.php +++ b/api/v3/examples/Im/Create.php @@ -22,7 +22,8 @@ function im_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Im/Delete.php b/api/v3/examples/Im/Delete.php index cbf48c075d..c1d2e2b091 100644 --- a/api/v3/examples/Im/Delete.php +++ b/api/v3/examples/Im/Delete.php @@ -19,7 +19,8 @@ function im_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function im_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/Im/Get.php b/api/v3/examples/Im/Get.php index 1d1afb45ec..b1daaeaee2 100644 --- a/api/v3/examples/Im/Get.php +++ b/api/v3/examples/Im/Get.php @@ -22,7 +22,8 @@ function im_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Job/Create.php b/api/v3/examples/Job/Create.php index 12a35425ac..5c8514e02f 100644 --- a/api/v3/examples/Job/Create.php +++ b/api/v3/examples/Job/Create.php @@ -26,7 +26,8 @@ function job_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Job/Delete.php b/api/v3/examples/Job/Delete.php index c7aefcbdff..fe854b3d27 100644 --- a/api/v3/examples/Job/Delete.php +++ b/api/v3/examples/Job/Delete.php @@ -19,7 +19,8 @@ function job_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/LineItem/Create.php b/api/v3/examples/LineItem/Create.php index 42085b693c..761cd1c264 100644 --- a/api/v3/examples/LineItem/Create.php +++ b/api/v3/examples/LineItem/Create.php @@ -26,7 +26,8 @@ function line_item_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -62,7 +63,7 @@ function line_item_create_expectedresult() { 'participant_count' => '', 'price_field_value_id' => '1', 'financial_type_id' => '', - 'deductible_amount' => '', + 'non_deductible_amount' => '', 'tax_amount' => '', ), ), diff --git a/api/v3/examples/LineItem/Delete.php b/api/v3/examples/LineItem/Delete.php index 62b9de0384..98c0496723 100644 --- a/api/v3/examples/LineItem/Delete.php +++ b/api/v3/examples/LineItem/Delete.php @@ -19,7 +19,8 @@ function line_item_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/LineItem/Get.php b/api/v3/examples/LineItem/Get.php index 4972579c3d..f1f8756091 100644 --- a/api/v3/examples/LineItem/Get.php +++ b/api/v3/examples/LineItem/Get.php @@ -19,7 +19,8 @@ function line_item_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -54,7 +55,8 @@ function line_item_get_expectedresult() { 'line_total' => '100.00', 'price_field_value_id' => '1', 'financial_type_id' => '1', - 'deductible_amount' => '0.00', + 'non_deductible_amount' => '0.00', + 'contribution_type_id' => '1', ), ), ); diff --git a/api/v3/examples/LocBlock/Create.php b/api/v3/examples/LocBlock/Create.php index 7c1410f0ec..328cec565f 100644 --- a/api/v3/examples/LocBlock/Create.php +++ b/api/v3/examples/LocBlock/Create.php @@ -23,7 +23,8 @@ function loc_block_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/LocBlock/CreateEntities.php b/api/v3/examples/LocBlock/CreateEntities.php index f6f33f9355..4af4802789 100644 --- a/api/v3/examples/LocBlock/CreateEntities.php +++ b/api/v3/examples/LocBlock/CreateEntities.php @@ -36,7 +36,8 @@ function loc_block_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/LocBlock/Get.php b/api/v3/examples/LocBlock/Get.php index d0f3868a0a..c323e43fb7 100644 --- a/api/v3/examples/LocBlock/Get.php +++ b/api/v3/examples/LocBlock/Get.php @@ -22,7 +22,8 @@ function loc_block_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Logging/Get.php b/api/v3/examples/Logging/Get.php index 6e904dee4d..2f9a4dae9b 100644 --- a/api/v3/examples/Logging/Get.php +++ b/api/v3/examples/Logging/Get.php @@ -19,7 +19,8 @@ function logging_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Logging/Revert.php b/api/v3/examples/Logging/Revert.php index 88a5514e23..1dad994344 100644 --- a/api/v3/examples/Logging/Revert.php +++ b/api/v3/examples/Logging/Revert.php @@ -20,7 +20,8 @@ function logging_revert_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailSettings/ChainedGetDelete.php b/api/v3/examples/MailSettings/ChainedGetDelete.php index 2c1e69bbab..39840638f0 100644 --- a/api/v3/examples/MailSettings/ChainedGetDelete.php +++ b/api/v3/examples/MailSettings/ChainedGetDelete.php @@ -22,7 +22,8 @@ function mail_settings_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailSettings/Create.php b/api/v3/examples/MailSettings/Create.php index f271945d8c..1542f116dd 100644 --- a/api/v3/examples/MailSettings/Create.php +++ b/api/v3/examples/MailSettings/Create.php @@ -26,7 +26,8 @@ function mail_settings_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailSettings/Delete.php b/api/v3/examples/MailSettings/Delete.php index 14cf3ba324..ffd138fc2d 100644 --- a/api/v3/examples/MailSettings/Delete.php +++ b/api/v3/examples/MailSettings/Delete.php @@ -19,7 +19,8 @@ function mail_settings_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailSettings/Get.php b/api/v3/examples/MailSettings/Get.php index 025ba20a82..53c8b81cb6 100644 --- a/api/v3/examples/MailSettings/Get.php +++ b/api/v3/examples/MailSettings/Get.php @@ -26,7 +26,8 @@ function mail_settings_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailSettings/GetOptions.php b/api/v3/examples/MailSettings/GetOptions.php index d63fe02d8f..ae99328f23 100644 --- a/api/v3/examples/MailSettings/GetOptions.php +++ b/api/v3/examples/MailSettings/GetOptions.php @@ -19,7 +19,8 @@ function mail_settings_getoptions_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Mailing/Clone.php b/api/v3/examples/Mailing/Clone.php new file mode 100644 index 0000000000..c91b47714f --- /dev/null +++ b/api/v3/examples/Mailing/Clone.php @@ -0,0 +1,118 @@ + 21, + ); + + try{ + $result = civicrm_api3('Mailing', 'clone', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mailing_clone_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 22, + 'values' => array( + '22' => array( + 'id' => '22', + 'domain_id' => '1', + 'header_id' => '1', + 'footer_id' => '2', + 'reply_id' => '8', + 'unsubscribe_id' => '5', + 'resubscribe_id' => '6', + 'optout_id' => '7', + 'name' => 'mailing name', + 'mailing_type' => 'standalone', + 'from_name' => 'FIXME', + 'from_email' => 'info@EXAMPLE.ORG', + 'replyto_email' => 'info@EXAMPLE.ORG', + 'template_type' => 'traditional', + 'template_options' => '', + 'subject' => 'Hello {contact.display_name}', + 'body_text' => 'This is {contact.display_name}. +https://civicrm.org +{domain.address}{action.optOutUrl}', + 'body_html' => '

This is {contact.display_name}.

CiviCRM.org

{domain.address}{action.optOutUrl}

', + 'url_tracking' => '1', + 'forward_replies' => 0, + 'auto_responder' => 0, + 'open_tracking' => '1', + 'is_completed' => '', + 'msg_template_id' => '', + 'override_verp' => '1', + 'created_id' => '147', + 'created_date' => '2013-07-28 08:49:19', + 'scheduled_id' => '', + 'scheduled_date' => '', + 'approver_id' => '', + 'approval_date' => '', + 'approval_status_id' => '', + 'approval_note' => '', + 'is_archived' => '', + 'visibility' => 'Public Pages', + 'campaign_id' => '', + 'dedupe_email' => '1', + 'sms_provider_id' => '', + 'hash' => '', + 'location_type_id' => '', + 'email_selection_method' => 'automatic', + 'language' => '', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testClone" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Mailing/Create.php b/api/v3/examples/Mailing/Create.php index 5772aa6201..0c5410ce6f 100644 --- a/api/v3/examples/Mailing/Create.php +++ b/api/v3/examples/Mailing/Create.php @@ -51,7 +51,8 @@ function mailing_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -84,13 +85,17 @@ function mailing_create_expectedresult() { 'resubscribe_id' => '6', 'optout_id' => '7', 'name' => 'mailing name', + 'mailing_type' => 'standalone', 'from_name' => 'FIXME', 'from_email' => 'info@EXAMPLE.ORG', 'replyto_email' => 'info@EXAMPLE.ORG', + 'template_type' => '', + 'template_options' => '', 'subject' => 'Hello {contact.display_name}', 'body_text' => 'This is {contact.display_name}. +https://civińcrm.org {domain.address}{action.optOutUrl}', - 'body_html' => '

This is {contact.display_name}.

{domain.address}{action.optOutUrl}

', + 'body_html' => '

This is {contact.display_name}.

CiviCRM.org

{domain.address}{action.optOutUrl}

', 'url_tracking' => '1', 'forward_replies' => '', 'auto_responder' => '', diff --git a/api/v3/examples/Mailing/Delete.php b/api/v3/examples/Mailing/Delete.php index 4f60cc881c..d274d8c825 100644 --- a/api/v3/examples/Mailing/Delete.php +++ b/api/v3/examples/Mailing/Delete.php @@ -19,7 +19,8 @@ function mailing_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function mailing_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/Mailing/GetTokens.php b/api/v3/examples/Mailing/GetTokens.php index 6ef6552673..e5a7be5d2a 100644 --- a/api/v3/examples/Mailing/GetTokens.php +++ b/api/v3/examples/Mailing/GetTokens.php @@ -25,7 +25,8 @@ function mailing_gettokens_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Mailing/Submit.php b/api/v3/examples/Mailing/Submit.php index fbf518322b..1b328b7e6c 100644 --- a/api/v3/examples/Mailing/Submit.php +++ b/api/v3/examples/Mailing/Submit.php @@ -21,7 +21,8 @@ function mailing_submit_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailingAB/Create.php b/api/v3/examples/MailingAB/Create.php index 674ea54bf9..e1189215f1 100644 --- a/api/v3/examples/MailingAB/Create.php +++ b/api/v3/examples/MailingAB/Create.php @@ -25,7 +25,8 @@ function mailing_a_b_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MailingEventSubscribe/Create.php b/api/v3/examples/MailingEventSubscribe/Create.php new file mode 100644 index 0000000000..0af6130cd2 --- /dev/null +++ b/api/v3/examples/MailingEventSubscribe/Create.php @@ -0,0 +1,81 @@ + 'test@test.test', + 'group_id' => 2, + 'contact_id' => 3, + 'hash' => 'b15de8b64e2cec34', + 'time_stamp' => '20101212121212', + ); + + try{ + $result = civicrm_api3('MailingEventSubscribe', 'create', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mailing_event_subscribe_create_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'contact_id' => '3', + 'subscribe_id' => '1', + 'hash' => '67eac7789eaee00', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testMailerGroupSubscribeGivenContactId" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingGroupTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Mapping/Create.php b/api/v3/examples/Mapping/Create.php new file mode 100644 index 0000000000..50459e16fd --- /dev/null +++ b/api/v3/examples/Mapping/Create.php @@ -0,0 +1,80 @@ + 'Mapping name', + 'description' => 'Mapping description', + 'mapping_type_id' => 7, + ); + + try{ + $result = civicrm_api3('Mapping', 'create', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mapping_create_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'id' => '1', + 'name' => 'Mapping name', + 'description' => 'Mapping description', + 'mapping_type_id' => '7', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testCreateMapping" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Mapping/Delete.php b/api/v3/examples/Mapping/Delete.php new file mode 100644 index 0000000000..cf598f7072 --- /dev/null +++ b/api/v3/examples/Mapping/Delete.php @@ -0,0 +1,70 @@ + 3, + ); + + try{ + $result = civicrm_api3('Mapping', 'delete', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mapping_delete_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'values' => 1, + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testDeleteMapping" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Mapping/Get.php b/api/v3/examples/Mapping/Get.php new file mode 100644 index 0000000000..f338822689 --- /dev/null +++ b/api/v3/examples/Mapping/Get.php @@ -0,0 +1,80 @@ + 'Mapping name', + 'description' => 'Mapping description', + 'mapping_type_id' => 7, + ); + + try{ + $result = civicrm_api3('Mapping', 'get', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mapping_get_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 2, + 'values' => array( + '2' => array( + 'id' => '2', + 'name' => 'Mapping name', + 'description' => 'Mapping description', + 'mapping_type_id' => '7', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testGetMapping" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/MappingField/Create.php b/api/v3/examples/MappingField/Create.php new file mode 100644 index 0000000000..9b80b2722f --- /dev/null +++ b/api/v3/examples/MappingField/Create.php @@ -0,0 +1,92 @@ + 1, + 'name' => 'last_name', + 'contact_type' => 'Individual', + 'column_number' => 2, + 'grouping' => 1, + ); + + try{ + $result = civicrm_api3('MappingField', 'create', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mapping_field_create_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'id' => '1', + 'mapping_id' => '1', + 'name' => 'last_name', + 'contact_type' => 'Individual', + 'column_number' => '2', + 'location_type_id' => '', + 'phone_type_id' => '', + 'im_provider_id' => '', + 'website_type_id' => '', + 'relationship_type_id' => '', + 'relationship_direction' => '', + 'grouping' => '1', + 'operator' => '', + 'value' => '', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testCreateMappingField" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingFieldTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/MappingField/Delete.php b/api/v3/examples/MappingField/Delete.php new file mode 100644 index 0000000000..ef27c0f18e --- /dev/null +++ b/api/v3/examples/MappingField/Delete.php @@ -0,0 +1,70 @@ + 3, + ); + + try{ + $result = civicrm_api3('MappingField', 'delete', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mapping_field_delete_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'values' => 1, + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testDeleteMappingField" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingFieldTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/MappingField/Get.php b/api/v3/examples/MappingField/Get.php new file mode 100644 index 0000000000..09d1f7df7b --- /dev/null +++ b/api/v3/examples/MappingField/Get.php @@ -0,0 +1,84 @@ + 2, + 'name' => 'last_name', + 'contact_type' => 'Individual', + 'column_number' => 2, + 'grouping' => 1, + ); + + try{ + $result = civicrm_api3('MappingField', 'get', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function mapping_field_get_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 2, + 'values' => array( + '2' => array( + 'id' => '2', + 'mapping_id' => '2', + 'name' => 'last_name', + 'contact_type' => 'Individual', + 'column_number' => '2', + 'grouping' => '1', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testGetMappingField" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MappingFieldTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Membership/Create.php b/api/v3/examples/Membership/Create.php index 0821f6b1db..5f765f3f79 100644 --- a/api/v3/examples/Membership/Create.php +++ b/api/v3/examples/Membership/Create.php @@ -26,7 +26,8 @@ function membership_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Membership/CreateWithCustomData.php b/api/v3/examples/Membership/CreateWithCustomData.php index 79ecdb7325..fe9516e663 100644 --- a/api/v3/examples/Membership/CreateWithCustomData.php +++ b/api/v3/examples/Membership/CreateWithCustomData.php @@ -27,7 +27,8 @@ function membership_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Membership/Delete.php b/api/v3/examples/Membership/Delete.php index 8ed8df71ce..953ecbffe6 100644 --- a/api/v3/examples/Membership/Delete.php +++ b/api/v3/examples/Membership/Delete.php @@ -8,6 +8,7 @@ function membership_delete_example() { $params = array( 'id' => 1, + 'preserve_contribution' => 1, ); try{ @@ -19,7 +20,8 @@ function membership_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -48,7 +50,7 @@ function membership_delete_expectedresult() { /* * This example has been generated from the API test suite. -* The test that created it is called "testMembershipDelete" +* The test that created it is called "testMembershipDeletePreserveContribution" * and can be found at: * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php * diff --git a/api/v3/examples/Membership/FilterIsCurrent.php b/api/v3/examples/Membership/FilterIsCurrent.php index 23d4ff6426..13dc628132 100644 --- a/api/v3/examples/Membership/FilterIsCurrent.php +++ b/api/v3/examples/Membership/FilterIsCurrent.php @@ -24,7 +24,8 @@ function membership_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Membership/Get.php b/api/v3/examples/Membership/Get.php index e09a1a50e0..20f24d537d 100644 --- a/api/v3/examples/Membership/Get.php +++ b/api/v3/examples/Membership/Get.php @@ -19,7 +19,8 @@ function membership_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Membership/SearchWithCustomData.php b/api/v3/examples/Membership/SearchWithCustomData.php new file mode 100644 index 0000000000..79ebb5a9c2 --- /dev/null +++ b/api/v3/examples/Membership/SearchWithCustomData.php @@ -0,0 +1,96 @@ + 94, + 'membership_type_id' => 57, + 'join_date' => '2009-01-21', + 'start_date' => '2009-01-21', + 'end_date' => '2009-12-21', + 'source' => 'Payment', + 'is_override' => 1, + 'status_id' => 35, + ); + + try{ + $result = civicrm_api3('Membership', 'create', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function membership_create_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'id' => '1', + 'contact_id' => '94', + 'membership_type_id' => '57', + 'join_date' => '20090121000000', + 'start_date' => '2013-07-29 00:00:00', + 'end_date' => '2013-08-04 00:00:00', + 'source' => 'Payment', + 'status_id' => '35', + 'is_override' => '1', + 'owner_membership_id' => '', + 'max_related' => '', + 'is_test' => 0, + 'is_pay_later' => '', + 'contribution_recur_id' => '', + 'campaign_id' => '', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testSearchWithCustomDataCRM16036" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/Membership/UpdateCustomData.php b/api/v3/examples/Membership/UpdateCustomData.php index 49e3b4b5ca..1b593b34c2 100644 --- a/api/v3/examples/Membership/UpdateCustomData.php +++ b/api/v3/examples/Membership/UpdateCustomData.php @@ -27,7 +27,8 @@ function membership_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MembershipPayment/Create.php b/api/v3/examples/MembershipPayment/Create.php index 3550d327eb..15f17ed82d 100644 --- a/api/v3/examples/MembershipPayment/Create.php +++ b/api/v3/examples/MembershipPayment/Create.php @@ -20,7 +20,8 @@ function membership_payment_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MembershipPayment/Get.php b/api/v3/examples/MembershipPayment/Get.php index b42b1d07eb..b93156fd3d 100644 --- a/api/v3/examples/MembershipPayment/Get.php +++ b/api/v3/examples/MembershipPayment/Get.php @@ -20,7 +20,8 @@ function membership_payment_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MembershipStatus/Create.php b/api/v3/examples/MembershipStatus/Create.php index 56b0ed0059..1bfd08c1e7 100644 --- a/api/v3/examples/MembershipStatus/Create.php +++ b/api/v3/examples/MembershipStatus/Create.php @@ -19,7 +19,8 @@ function membership_status_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MembershipStatus/Get.php b/api/v3/examples/MembershipStatus/Get.php index f3b8b20430..0291fdb620 100644 --- a/api/v3/examples/MembershipStatus/Get.php +++ b/api/v3/examples/MembershipStatus/Get.php @@ -19,7 +19,8 @@ function membership_status_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MembershipType/Create.php b/api/v3/examples/MembershipType/Create.php index ad4dd238e0..81cff6e5ae 100644 --- a/api/v3/examples/MembershipType/Create.php +++ b/api/v3/examples/MembershipType/Create.php @@ -28,7 +28,8 @@ function membership_type_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -72,7 +73,7 @@ function membership_type_create_expectedresult() { 'receipt_text_signup' => '', 'receipt_text_renewal' => '', 'auto_renew' => '', - 'is_active' => '', + 'is_active' => '1', 'contribution_type_id' => '1', ), ), diff --git a/api/v3/examples/MembershipType/Delete.php b/api/v3/examples/MembershipType/Delete.php index 6a12a8a1e2..2c08431368 100644 --- a/api/v3/examples/MembershipType/Delete.php +++ b/api/v3/examples/MembershipType/Delete.php @@ -19,7 +19,8 @@ function membership_type_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function membership_type_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/MembershipType/Get.php b/api/v3/examples/MembershipType/Get.php index e3d8fa2a57..f111b04bd4 100644 --- a/api/v3/examples/MembershipType/Get.php +++ b/api/v3/examples/MembershipType/Get.php @@ -19,7 +19,8 @@ function membership_type_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MessageTemplate/Create.php b/api/v3/examples/MessageTemplate/Create.php index af72d924c6..0941182339 100644 --- a/api/v3/examples/MessageTemplate/Create.php +++ b/api/v3/examples/MessageTemplate/Create.php @@ -25,7 +25,8 @@ function message_template_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/MessageTemplate/Delete.php b/api/v3/examples/MessageTemplate/Delete.php index c18d9b93f0..1d47b6f0c8 100644 --- a/api/v3/examples/MessageTemplate/Delete.php +++ b/api/v3/examples/MessageTemplate/Delete.php @@ -19,7 +19,8 @@ function message_template_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function message_template_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/MessageTemplate/Get.php b/api/v3/examples/MessageTemplate/Get.php index af55e83b25..d3ab1005bc 100644 --- a/api/v3/examples/MessageTemplate/Get.php +++ b/api/v3/examples/MessageTemplate/Get.php @@ -25,7 +25,8 @@ function message_template_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Note/Create.php b/api/v3/examples/Note/Create.php index 55c838ba45..949de28248 100644 --- a/api/v3/examples/Note/Create.php +++ b/api/v3/examples/Note/Create.php @@ -24,7 +24,8 @@ function note_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Note/Delete.php b/api/v3/examples/Note/Delete.php index 7f1e6c7657..43d8b4f7f1 100644 --- a/api/v3/examples/Note/Delete.php +++ b/api/v3/examples/Note/Delete.php @@ -19,7 +19,8 @@ function note_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Note/Get.php b/api/v3/examples/Note/Get.php index a794862afa..8fea36b90b 100644 --- a/api/v3/examples/Note/Get.php +++ b/api/v3/examples/Note/Get.php @@ -20,7 +20,8 @@ function note_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/OpenID/Create.php b/api/v3/examples/OpenID/Create.php new file mode 100644 index 0000000000..aeba330a1f --- /dev/null +++ b/api/v3/examples/OpenID/Create.php @@ -0,0 +1,82 @@ + 3, + 'openid' => 'My OpenID handle', + 'location_type_id' => 1, + ); + + try{ + $result = civicrm_api3('OpenID', 'create', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function open_i_d_create_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'id' => '1', + 'contact_id' => '3', + 'location_type_id' => '1', + 'openid' => 'My OpenID handle', + 'allowed_to_login' => '', + 'is_primary' => '', + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testCreateOpenID" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OpenIDTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/OpenID/Delete.php b/api/v3/examples/OpenID/Delete.php new file mode 100644 index 0000000000..9f6d1cebd3 --- /dev/null +++ b/api/v3/examples/OpenID/Delete.php @@ -0,0 +1,70 @@ + 3, + ); + + try{ + $result = civicrm_api3('OpenID', 'delete', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function open_i_d_delete_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'values' => 1, + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testDeleteOpenID" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OpenIDTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/OpenID/Get.php b/api/v3/examples/OpenID/Get.php new file mode 100644 index 0000000000..ec8eb8c425 --- /dev/null +++ b/api/v3/examples/OpenID/Get.php @@ -0,0 +1,82 @@ + 4, + 'openid' => 'My OpenID handle', + 'location_type_id' => 1, + ); + + try{ + $result = civicrm_api3('OpenID', 'get', $params); + } + catch (CiviCRM_API3_Exception $e) { + // Handle error here. + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array( + 'is_error' => 1, + 'error_message' => $errorMessage, + 'error_code' => $errorCode, + 'error_data' => $errorData, + ); + } + + return $result; +} + +/** + * Function returns array of result expected from previous function. + * + * @return array + * API result array + */ +function open_i_d_get_expectedresult() { + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 2, + 'values' => array( + '2' => array( + 'id' => '2', + 'contact_id' => '4', + 'location_type_id' => '1', + 'openid' => 'My OpenID handle', + 'allowed_to_login' => 0, + 'is_primary' => 0, + ), + ), + ); + + return $expectedResult; +} + +/* +* This example has been generated from the API test suite. +* The test that created it is called "testGetOpenID" +* and can be found at: +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OpenIDTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/api/v3/examples/OptionGroup/Create.php b/api/v3/examples/OptionGroup/Create.php index d6749ef81e..7220e3db6e 100644 --- a/api/v3/examples/OptionGroup/Create.php +++ b/api/v3/examples/OptionGroup/Create.php @@ -29,7 +29,8 @@ function option_group_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/OptionGroup/Delete.php b/api/v3/examples/OptionGroup/Delete.php index 4c8490e38c..cdf194ec75 100644 --- a/api/v3/examples/OptionGroup/Delete.php +++ b/api/v3/examples/OptionGroup/Delete.php @@ -19,7 +19,8 @@ function option_group_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -40,7 +41,7 @@ function option_group_delete_expectedresult() { 'is_error' => 0, 'version' => 3, 'count' => 1, - 'values' => TRUE, + 'values' => 1, ); return $expectedResult; diff --git a/api/v3/examples/OptionGroup/Get.php b/api/v3/examples/OptionGroup/Get.php index 8351caf850..0b24c9013e 100644 --- a/api/v3/examples/OptionGroup/Get.php +++ b/api/v3/examples/OptionGroup/Get.php @@ -19,7 +19,8 @@ function option_group_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/OptionValue/Get.php b/api/v3/examples/OptionValue/Get.php index 7a291319f1..964c41ffdc 100644 --- a/api/v3/examples/OptionValue/Get.php +++ b/api/v3/examples/OptionValue/Get.php @@ -19,7 +19,8 @@ function option_value_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -46,6 +47,7 @@ function option_value_get_expectedresult() { 'option_group_id' => '1', 'label' => 'Phone', 'value' => '1', + 'name' => 'Phone', 'filter' => 0, 'weight' => '1', 'is_optgroup' => 0, @@ -57,6 +59,7 @@ function option_value_get_expectedresult() { 'option_group_id' => '1', 'label' => 'Email', 'value' => '2', + 'name' => 'Email', 'filter' => 0, 'weight' => '2', 'is_optgroup' => 0, @@ -68,6 +71,7 @@ function option_value_get_expectedresult() { 'option_group_id' => '1', 'label' => 'Postal Mail', 'value' => '3', + 'name' => 'Postal Mail', 'filter' => 0, 'weight' => '3', 'is_optgroup' => 0, @@ -79,6 +83,7 @@ function option_value_get_expectedresult() { 'option_group_id' => '1', 'label' => 'SMS', 'value' => '4', + 'name' => 'SMS', 'filter' => 0, 'weight' => '4', 'is_optgroup' => 0, @@ -90,6 +95,7 @@ function option_value_get_expectedresult() { 'option_group_id' => '1', 'label' => 'Fax', 'value' => '5', + 'name' => 'Fax', 'filter' => 0, 'weight' => '5', 'is_optgroup' => 0, diff --git a/api/v3/examples/OptionValue/SortOption.php b/api/v3/examples/OptionValue/SortOption.php index b0ed2bdaf4..b7253c8ef4 100644 --- a/api/v3/examples/OptionValue/SortOption.php +++ b/api/v3/examples/OptionValue/SortOption.php @@ -25,7 +25,8 @@ function option_value_getsingle_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -47,6 +48,7 @@ function option_value_getsingle_expectedresult() { 'option_group_id' => '1', 'label' => 'SMS', 'value' => '4', + 'name' => 'SMS', 'filter' => 0, 'weight' => '4', 'is_optgroup' => 0, diff --git a/api/v3/examples/Order/Cancel.php b/api/v3/examples/Order/Cancel.php index 4333e1f116..30f5aad2c5 100644 --- a/api/v3/examples/Order/Cancel.php +++ b/api/v3/examples/Order/Cancel.php @@ -19,7 +19,8 @@ function order_cancel_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -71,6 +72,7 @@ function order_cancel_expectedresult() { 'campaign_id' => '', 'creditnote_id' => 'CN_1', 'tax_amount' => '', + 'revenue_recognition_date' => '', 'contribution_type_id' => '1', ), ), diff --git a/api/v3/examples/Order/Create.php b/api/v3/examples/Order/Create.php index 6dfbae5ea6..45ea551fcd 100644 --- a/api/v3/examples/Order/Create.php +++ b/api/v3/examples/Order/Create.php @@ -51,7 +51,8 @@ function order_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -103,6 +104,7 @@ function order_create_expectedresult() { 'campaign_id' => '', 'creditnote_id' => '', 'tax_amount' => '', + 'revenue_recognition_date' => '', 'contribution_type_id' => '1', ), ), diff --git a/api/v3/examples/Order/CreateOrderParticipant.php b/api/v3/examples/Order/CreateOrderParticipant.php index 6737b8d3da..aa65ab5fd0 100644 --- a/api/v3/examples/Order/CreateOrderParticipant.php +++ b/api/v3/examples/Order/CreateOrderParticipant.php @@ -61,7 +61,8 @@ function order_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -113,6 +114,7 @@ function order_create_expectedresult() { 'campaign_id' => '', 'creditnote_id' => '', 'tax_amount' => '', + 'revenue_recognition_date' => '', 'contribution_type_id' => '1', ), ), @@ -123,7 +125,7 @@ function order_create_expectedresult() { /* * This example has been generated from the API test suite. -* The test that created it is called "testAddOrderForPariticipant" +* The test that created it is called "testAddOrderForParticipant" * and can be found at: * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OrderTest.php * diff --git a/api/v3/examples/Order/Delete.php b/api/v3/examples/Order/Delete.php index bb771e1349..9021a479a8 100644 --- a/api/v3/examples/Order/Delete.php +++ b/api/v3/examples/Order/Delete.php @@ -19,7 +19,8 @@ function order_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Order/Get.php b/api/v3/examples/Order/Get.php index 7f3dace4c9..10a3c2c849 100644 --- a/api/v3/examples/Order/Get.php +++ b/api/v3/examples/Order/Get.php @@ -19,7 +19,8 @@ function order_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Participant/Create.php b/api/v3/examples/Participant/Create.php index 54bf5c55b2..8ab8b98dda 100644 --- a/api/v3/examples/Participant/Create.php +++ b/api/v3/examples/Participant/Create.php @@ -25,7 +25,8 @@ function participant_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -67,6 +68,7 @@ function participant_create_expectedresult() { 'discount_amount' => '', 'cart_id' => '', 'must_wait' => '', + 'transferred_to_contact_id' => '', ), ), ); diff --git a/api/v3/examples/Participant/Get.php b/api/v3/examples/Participant/Get.php index 5c1fb35e05..1e06e9540e 100644 --- a/api/v3/examples/Participant/Get.php +++ b/api/v3/examples/Participant/Get.php @@ -19,7 +19,8 @@ function participant_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Participant/NestedDelete.php b/api/v3/examples/Participant/NestedDelete.php index 48277c28b4..b9429731c7 100644 --- a/api/v3/examples/Participant/NestedDelete.php +++ b/api/v3/examples/Participant/NestedDelete.php @@ -22,7 +22,8 @@ function participant_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Participant/NestedEventGet.php b/api/v3/examples/Participant/NestedEventGet.php index 8d989c2533..78f22366da 100644 --- a/api/v3/examples/Participant/NestedEventGet.php +++ b/api/v3/examples/Participant/NestedEventGet.php @@ -22,7 +22,8 @@ function participant_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); @@ -107,7 +108,10 @@ function participant_get_expectedresult() { 'is_pay_later' => 0, 'is_partial_payment' => 0, 'is_multiple_registrations' => 0, + 'max_additional_participants' => 0, 'allow_same_participant_emails' => 0, + 'allow_selfcancelxfer' => 0, + 'selfcancelxfer_time' => 0, 'is_template' => 0, 'created_date' => '2013-07-28 08:49:19', 'is_share' => '1', diff --git a/api/v3/examples/ParticipantPayment/Create.php b/api/v3/examples/ParticipantPayment/Create.php index 00d52347b7..5dca9fe9f3 100644 --- a/api/v3/examples/ParticipantPayment/Create.php +++ b/api/v3/examples/ParticipantPayment/Create.php @@ -20,7 +20,8 @@ function participant_payment_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ParticipantPayment/Delete.php b/api/v3/examples/ParticipantPayment/Delete.php index 7088a0d18e..c7e48e4eef 100644 --- a/api/v3/examples/ParticipantPayment/Delete.php +++ b/api/v3/examples/ParticipantPayment/Delete.php @@ -19,7 +19,8 @@ function participant_payment_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ParticipantPayment/Get.php b/api/v3/examples/ParticipantPayment/Get.php index c119289a66..eaf18755b8 100644 --- a/api/v3/examples/ParticipantPayment/Get.php +++ b/api/v3/examples/ParticipantPayment/Get.php @@ -20,7 +20,8 @@ function participant_payment_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ParticipantStatusType/Create.php b/api/v3/examples/ParticipantStatusType/Create.php index ed6ab392e5..96a4481c51 100644 --- a/api/v3/examples/ParticipantStatusType/Create.php +++ b/api/v3/examples/ParticipantStatusType/Create.php @@ -26,7 +26,8 @@ function participant_status_type_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ParticipantStatusType/Delete.php b/api/v3/examples/ParticipantStatusType/Delete.php index 7b2a442791..258aa4af10 100644 --- a/api/v3/examples/ParticipantStatusType/Delete.php +++ b/api/v3/examples/ParticipantStatusType/Delete.php @@ -19,7 +19,8 @@ function participant_status_type_delete_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/ParticipantStatusType/Get.php b/api/v3/examples/ParticipantStatusType/Get.php index 38c57c57fb..318d9b5e79 100644 --- a/api/v3/examples/ParticipantStatusType/Get.php +++ b/api/v3/examples/ParticipantStatusType/Get.php @@ -26,7 +26,8 @@ function participant_status_type_get_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/PaymentProcessor/Create.php b/api/v3/examples/PaymentProcessor/Create.php index 8ca5613c92..7d911e279a 100644 --- a/api/v3/examples/PaymentProcessor/Create.php +++ b/api/v3/examples/PaymentProcessor/Create.php @@ -23,7 +23,8 @@ function payment_processor_create_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/api/v3/examples/Phone/GetOptions.php b/api/v3/examples/Phone/GetOptions.php index 3b236b659f..777f4a7ada 100644 --- a/api/v3/examples/Phone/GetOptions.php +++ b/api/v3/examples/Phone/GetOptions.php @@ -19,7 +19,8 @@ function phone_getoptions_example() { $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); return array( - 'error' => $errorMessage, + 'is_error' => 1, + 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, ); diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index d652063920..2b76a3add9 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -115,7 +115,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { 'currency' => 'NZD', 'financial_type_id' => 1, ); - $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__); + $getResult = $this->callAPISuccess($this->_entity, 'get', $getParams); $this->assertEquals(1, $getResult['count']); } @@ -337,7 +337,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { 'cvv2' => 123, ); - $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL); + $this->callAPISuccess('contribution_page', 'submit', $submitParams); $contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page'])); $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id'])); $mut->checkMailLog(array( @@ -367,7 +367,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { 'email-Primary' => 'billy-goat@the-new-bridge.net', ); - $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL); + $this->callAPISuccess('contribution_page', 'submit', $submitParams); $contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page'])); $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id'])); $mut->checkMailLog(array( @@ -398,7 +398,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { 'selectMembership' => $this->_ids['membership_type'], ); - $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL); + $this->callAPISuccess('contribution_page', 'submit', $submitParams); $contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page'])); $this->assertCount(2, $contributions['values']); $lines = $this->callAPISuccess('LineItem', 'get', array('sequential' => 1)); @@ -433,7 +433,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase { 'cvv2' => 123, ); - $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL); + $this->callAPISuccess('contribution_page', 'submit', $submitParams); $contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page'])); $this->assertCount(2, $contributions['values']); $membershipPayment = $this->callAPISuccess('membership_payment', 'getsingle', array()); diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 2d7b1db8ca..556dab2760 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -295,7 +295,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { $params = array( 'contribution_id' => $this->_contribution['id'], ); - $contribution = $this->callAPIAndDocument('contribution', 'get', $params, __FUNCTION__, __FILE__); + $contribution = $this->callAPISuccess('contribution', 'get', $params); $financialParams['id'] = $this->_financialTypeId; $default = NULL; CRM_Financial_BAO_FinancialType::retrieve($financialParams, $default); @@ -495,7 +495,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contribution_status_id' => 1, ); - $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); + $contribution = $this->callAPISuccess('contribution', 'create', $params); $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00); $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1); @@ -869,7 +869,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contribution_status_id' => 1, ); - $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); + $contribution = $this->callAPISuccess('contribution', 'create', $params); $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00); $this->assertEquals($contribution['values'][$contribution['id']]['fee_amount'], 50.00); @@ -922,7 +922,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { ); - $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); + $contribution = $this->callAPISuccess('contribution', 'create', $params); $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00); $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1); @@ -1015,7 +1015,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase { 'contribution_status_id' => 2, ); - $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); + $contribution = $this->callAPISuccess('contribution', 'create', $params); $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00); $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1); diff --git a/tests/phpunit/api/v3/FinancialTypeACLTest.php b/tests/phpunit/api/v3/FinancialTypeACLTest.php index cd986906f2..e2dea8467c 100644 --- a/tests/phpunit/api/v3/FinancialTypeACLTest.php +++ b/tests/phpunit/api/v3/FinancialTypeACLTest.php @@ -251,9 +251,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { ), ); - $description = "Create Contribution with Nested Line Items."; - $subfile = "CreateWithNestedLineItems"; - $config = &CRM_Core_Config::singleton(); + $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', @@ -262,7 +260,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'add contributions of type Donation', 'delete contributions of type Donation', ); - $contribution = $this->callAPIFailure('contribution', 'create', $params, 'Error in call to LineItem_create : You do not have permission to create this line item'); + $this->callAPIFailure('contribution', 'create', $params, 'Error in call to LineItem_create : You do not have permission to create this line item'); // Check that the entire contribution has rolled back. $contribution = $this->callAPISuccess('contribution', 'get', array()); @@ -270,14 +268,14 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { CRM_Financial_BAO_FinancialType::$_availableFinancialTypes = NULL; - $config = &CRM_Core_Config::singleton(); + $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array_merge($config->userPermissionClass->permissions, array( 'add contributions of type Member Dues', 'view contributions of type Donation', 'view contributions of type Member Dues', 'delete contributions of type Member Dues', )); - $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile); + $contribution = $this->callAPISuccess('contribution', 'create', $params); $lineItemParams = array( 'contribution_id' => $contribution['id'], @@ -309,14 +307,14 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'check_permissions' => TRUE, 'total_amount' => 200.00, ); - $config = &CRM_Core_Config::singleton(); + $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', 'edit contributions', 'view contributions of type Donation', ); - $contribution = $this->callAPIFailure('Contribution', 'create', $params); + $this->callAPIFailure('Contribution', 'create', $params); $config->userPermissionClass->permissions[] = 'edit contributions of type Donation'; $contribution = $this->callAPISuccess('Contribution', 'create', $params); @@ -329,7 +327,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { */ public function testDeleteACLContribution() { $this->setACL(); - $config = &CRM_Core_Config::singleton(); + $config = CRM_Core_Config::singleton(); $config->userPermissionClass->permissions = array( 'access CiviCRM', 'access CiviContribute', @@ -343,7 +341,7 @@ class api_v3_FinancialTypeACLTest extends CiviUnitTestCase { 'check_permissions' => TRUE, ); $config->userPermissionClass->permissions[3] = 'delete in CiviContribute'; - $contribution = $this->callAPIFailure('Contribution', 'delete', $params); + $this->callAPIFailure('Contribution', 'delete', $params); $config->userPermissionClass->permissions[] = 'delete contributions of type Donation'; $contribution = $this->callAPISuccess('Contribution', 'delete', $params); -- 2.25.1