CRM-15988 - Update generated examples
authorColeman Watts <coleman@civicrm.org>
Mon, 23 Feb 2015 16:36:57 +0000 (11:36 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 23 Feb 2015 18:21:39 +0000 (13:21 -0500)
261 files changed:
api/api.php
api/v3/examples/Activity/ContactRefCustomField.php
api/v3/examples/Activity/ContactRefCustomFieldGet.php
api/v3/examples/Activity/Create.php
api/v3/examples/Activity/DateTimeHigh.php
api/v3/examples/Activity/DateTimeLow.php
api/v3/examples/Activity/Delete.php
api/v3/examples/Activity/Get.php
api/v3/examples/Activity/GetFields.php [moved from api/v3/examples/Activity/Getfields.php with 98% similarity]
api/v3/examples/Activity/GetTargetandAssignee.php
api/v3/examples/Activity/ReturnAssigneeContact.php
api/v3/examples/ActivityContact/Create.php
api/v3/examples/ActivityContact/Delete.php
api/v3/examples/ActivityType/Create.php
api/v3/examples/ActivityType/Get.php
api/v3/examples/Address/AddressLike.php
api/v3/examples/Address/AddressParse.php
api/v3/examples/Address/AddressSort.php
api/v3/examples/Address/Create.php
api/v3/examples/Address/Delete.php
api/v3/examples/Address/Get.php
api/v3/examples/Address/GetOptions.php [new file with mode: 0644]
api/v3/examples/Batch/Create.php
api/v3/examples/Batch/Delete.php
api/v3/examples/Batch/Get.php
api/v3/examples/Campaign/Create.php
api/v3/examples/Campaign/Delete.php
api/v3/examples/Campaign/Get.php
api/v3/examples/Case/Create.php
api/v3/examples/Constant/Get.php
api/v3/examples/Contact/APIChainedArray.php
api/v3/examples/Contact/APIChainedArrayFormats.php
api/v3/examples/Contact/APIChainedArrayMultipleCustom.php
api/v3/examples/Contact/APIChainedArrayValuesFromSiblingFunction.php
api/v3/examples/Contact/ChainTwoWebsites.php
api/v3/examples/Contact/ChainTwoWebsitesSyntax2.php
api/v3/examples/Contact/Create.php
api/v3/examples/Contact/CreateParticipantPayment.php [moved from api/v3/examples/Participant/CreateParticipantPayment.php with 93% similarity]
api/v3/examples/Contact/CustomFieldGet.php
api/v3/examples/Contact/CustomFieldGetReturnSyntaxVariation.php
api/v3/examples/Contact/Delete.php
api/v3/examples/Contact/FormatIsSuccess_Fail.php
api/v3/examples/Contact/FormatIsSuccess_True.php
api/v3/examples/Contact/FormatOnlyID.php
api/v3/examples/Contact/FormatSingleValue.php
api/v3/examples/Contact/Get.php
api/v3/examples/Contact/GetActions.php
api/v3/examples/Contact/GetCountContact.php
api/v3/examples/Contact/GetFieldsOptions.php
api/v3/examples/Contact/GetOptions.php [moved from api/v3/examples/Contact/Getoptions.php with 86% similarity]
api/v3/examples/Contact/GetSingleContact.php
api/v3/examples/Contact/GroupFilterUsingContactAPI.php
api/v3/examples/Contact/NestedReplaceEmail.php [moved from api/v3/examples/Email/NestedReplaceEmail.php with 96% similarity]
api/v3/examples/Contribution/ContributionCreateWithHonoreeContact.php
api/v3/examples/Contribution/ContributionCreateWithNote.php
api/v3/examples/Contribution/ContributionCreateWithSoftCredit.php
api/v3/examples/Contribution/ContributionCreateWithSoftCreditDefaults.php
api/v3/examples/Contribution/Create.php
api/v3/examples/Contribution/CreateWithNestedLineItems.php
api/v3/examples/Contribution/Delete.php
api/v3/examples/Contribution/Get.php
api/v3/examples/ContributionPage/Create.php
api/v3/examples/ContributionPage/Delete.php
api/v3/examples/ContributionPage/Get.php
api/v3/examples/ContributionPage/Submit.php
api/v3/examples/ContributionRecur/Create.php
api/v3/examples/ContributionRecur/Delete.php
api/v3/examples/ContributionRecur/Get.php
api/v3/examples/ContributionSoft/Create.php
api/v3/examples/ContributionSoft/Delete.php
api/v3/examples/ContributionSoft/Get.php
api/v3/examples/Country/Create.php
api/v3/examples/Country/Delete.php
api/v3/examples/Country/Get.php
api/v3/examples/CustomField/Create.php
api/v3/examples/CustomField/Delete.php
api/v3/examples/CustomGroup/Create.php
api/v3/examples/CustomGroup/Delete.php
api/v3/examples/CustomGroup/Get.php
api/v3/examples/CustomValue/Create.php
api/v3/examples/CustomValue/FormatFieldName.php [moved from api/v3/examples/CustomValue/formatFieldName.php with 92% similarity]
api/v3/examples/CustomValue/Get.php
api/v3/examples/Domain/Create.php
api/v3/examples/Domain/Get.php
api/v3/examples/Email/Create.php
api/v3/examples/Email/Delete.php
api/v3/examples/Email/Replace.php
api/v3/examples/EntityTag/Create.php
api/v3/examples/EntityTag/Delete.php
api/v3/examples/EntityTag/Get.php
api/v3/examples/Event/Create.php
api/v3/examples/Event/Delete.php
api/v3/examples/Event/Get.php
api/v3/examples/Event/IsCurrentOption.php
api/v3/examples/Event/IsFullOption.php
api/v3/examples/Grant/Create.php
api/v3/examples/Grant/Delete.php
api/v3/examples/Grant/Get.php
api/v3/examples/Group/Get.php
api/v3/examples/Group/GetFields.php [moved from api/v3/examples/Group/getfields.php with 96% similarity]
api/v3/examples/GroupContact/Create.php
api/v3/examples/GroupContact/Delete.php
api/v3/examples/GroupContact/Get.php
api/v3/examples/GroupContact/GetWithGroupID.php
api/v3/examples/GroupNesting/Create.php
api/v3/examples/GroupNesting/Delete.php
api/v3/examples/GroupNesting/Get.php
api/v3/examples/GroupOrganization/Create.php
api/v3/examples/GroupOrganization/Delete.php
api/v3/examples/GroupOrganization/Get.php
api/v3/examples/Im/Create.php
api/v3/examples/Im/Delete.php
api/v3/examples/Im/Get.php
api/v3/examples/Job/Create.php
api/v3/examples/Job/Delete.php
api/v3/examples/LineItem/Create.php
api/v3/examples/LineItem/Delete.php
api/v3/examples/LineItem/Get.php
api/v3/examples/LocBlock/Create.php [moved from api/v3/examples/LocBlock/simpleCreate.php with 89% similarity]
api/v3/examples/LocBlock/CreateEntities.php [moved from api/v3/examples/LocBlock/createEntities.php with 94% similarity]
api/v3/examples/LocBlock/Get.php [moved from api/v3/examples/LocBlock/getEntities.php with 92% similarity]
api/v3/examples/MailSettings/ChainedGetDelete.php
api/v3/examples/MailSettings/Create.php
api/v3/examples/MailSettings/Delete.php
api/v3/examples/MailSettings/Get.php
api/v3/examples/MailSettings/GetOptions.php [new file with mode: 0644]
api/v3/examples/Mailing/Create.php
api/v3/examples/Mailing/Delete.php
api/v3/examples/Mailing/Submit.php
api/v3/examples/MailingAB/Create.php
api/v3/examples/Membership/Create.php
api/v3/examples/Membership/CreateWithCustomData.php [new file with mode: 0644]
api/v3/examples/Membership/Delete.php
api/v3/examples/Membership/FilterIsCurrent.php [moved from api/v3/examples/Membership/filterIsCurrent.php with 90% similarity]
api/v3/examples/Membership/Get.php
api/v3/examples/Membership/UpdateCustomData.php [moved from api/v3/examples/Membership/Update.php with 87% similarity]
api/v3/examples/MembershipPayment/Create.php
api/v3/examples/MembershipPayment/Get.php
api/v3/examples/MembershipStatus/Create.php
api/v3/examples/MembershipStatus/Get.php
api/v3/examples/MembershipType/Create.php
api/v3/examples/MembershipType/Delete.php
api/v3/examples/MembershipType/Get.php
api/v3/examples/MessageTemplate/Create.php
api/v3/examples/MessageTemplate/Delete.php
api/v3/examples/MessageTemplate/Get.php
api/v3/examples/Note/Create.php
api/v3/examples/Note/Delete.php
api/v3/examples/Note/Get.php
api/v3/examples/OptionGroup/Create.php
api/v3/examples/OptionGroup/Delete.php
api/v3/examples/OptionGroup/Get.php
api/v3/examples/OptionValue/Get.php
api/v3/examples/OptionValue/SortOption.php
api/v3/examples/Participant/Create.php
api/v3/examples/Participant/Get.php
api/v3/examples/Participant/NestedDelete.php
api/v3/examples/Participant/NestedEventGet.php
api/v3/examples/ParticipantPayment/Create.php
api/v3/examples/ParticipantPayment/Delete.php
api/v3/examples/ParticipantPayment/Get.php
api/v3/examples/ParticipantStatusType/Create.php
api/v3/examples/ParticipantStatusType/Delete.php
api/v3/examples/ParticipantStatusType/Get.php
api/v3/examples/PaymentProcessor/Create.php
api/v3/examples/PaymentProcessor/Delete.php
api/v3/examples/PaymentProcessorType/Create.php
api/v3/examples/PaymentProcessorType/Delete.php
api/v3/examples/Phone/Create.php
api/v3/examples/Phone/Delete.php
api/v3/examples/Phone/Get.php
api/v3/examples/Phone/GetOptions.php [new file with mode: 0644]
api/v3/examples/Pledge/Create.php
api/v3/examples/Pledge/Delete.php
api/v3/examples/Pledge/Get.php
api/v3/examples/Pledge/GetFilterHighDate.php
api/v3/examples/PledgePayment/Create.php
api/v3/examples/PledgePayment/Delete.php
api/v3/examples/PledgePayment/Get.php
api/v3/examples/PledgePayment/Update.php
api/v3/examples/PriceField/Create.php
api/v3/examples/PriceField/Delete.php
api/v3/examples/PriceField/Get.php
api/v3/examples/PriceFieldValue/Create.php
api/v3/examples/PriceFieldValue/Delete.php
api/v3/examples/PriceFieldValue/Get.php
api/v3/examples/PriceSet/Create.php
api/v3/examples/PriceSet/Delete.php
api/v3/examples/PriceSet/Get.php
api/v3/examples/Profile/Apply.php
api/v3/examples/Profile/Get.php
api/v3/examples/Profile/GetFields.php
api/v3/examples/Profile/Submit.php
api/v3/examples/Relationship/BetweenRelationshipType.php
api/v3/examples/Relationship/Create.php
api/v3/examples/Relationship/Delete.php
api/v3/examples/Relationship/Get.php
api/v3/examples/Relationship/INRelationshipType.php
api/v3/examples/Relationship/NotBetweenRelationshipType.php
api/v3/examples/Relationship/NotInRelationshipType.php
api/v3/examples/Relationship/filterIsCurrent.php
api/v3/examples/RelationshipType/Create.php
api/v3/examples/RelationshipType/Delete.php
api/v3/examples/ReportTemplate/Getrows.php
api/v3/examples/ReportTemplate/Getstatistics.php
api/v3/examples/Setting/Create.php
api/v3/examples/Setting/CreateAllDomains.php
api/v3/examples/Setting/CreateSettingCurrentDomain.php
api/v3/examples/Setting/CreateSpecifiedDomains.php
api/v3/examples/Setting/Get.php
api/v3/examples/Setting/GetAllDomains.php
api/v3/examples/Setting/GetDefaults.php
api/v3/examples/Setting/GetFields.php
api/v3/examples/Setting/GetSettingCurrentDomain.php
api/v3/examples/Setting/GetSpecifiedDomains.php
api/v3/examples/Setting/GetValue.php
api/v3/examples/Setting/Revert.php
api/v3/examples/Survey/ChainedGetDelete.php
api/v3/examples/Survey/Create.php
api/v3/examples/Survey/Delete.php
api/v3/examples/Survey/Get.php
api/v3/examples/SurveyRespondant/Get.php
api/v3/examples/System/Flush.php
api/v3/examples/Tag/Create.php
api/v3/examples/Tag/Delete.php
api/v3/examples/Tag/Get.php
api/v3/examples/Tag/GetFields.php [moved from api/v3/examples/Tag/Getfields.php with 94% similarity]
api/v3/examples/Tag/GetList.php
api/v3/examples/Tag/GetReturnArray.php [moved from api/v3/examples/Tag/getReturnArray.php with 89% similarity]
api/v3/examples/UFField/Create.php
api/v3/examples/UFField/Delete.php
api/v3/examples/UFField/Get.php
api/v3/examples/UFField/Replace.php
api/v3/examples/UFGroup/Create.php
api/v3/examples/UFGroup/Delete.php
api/v3/examples/UFGroup/Get.php
api/v3/examples/UFJoin/Create.php
api/v3/examples/UFJoin/Get.php
api/v3/examples/UFMatch/Get.php
api/v3/examples/Website/Create.php
api/v3/examples/Website/Delete.php
api/v3/examples/Website/Get.php
api/v3/examples/Website/GetFields.php
api/v3/examples/Website/GetWithMetadata.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/api/v3/ActivityTest.php
tests/phpunit/api/v3/ConstantTest.php
tests/phpunit/api/v3/ContactTest.php
tests/phpunit/api/v3/ContributionPageTest.php
tests/phpunit/api/v3/CustomFieldTest.php
tests/phpunit/api/v3/CustomValueTest.php
tests/phpunit/api/v3/EntityTagTest.php
tests/phpunit/api/v3/EventTest.php
tests/phpunit/api/v3/GroupTest.php
tests/phpunit/api/v3/LocBlockTest.php
tests/phpunit/api/v3/MembershipTest.php
tests/phpunit/api/v3/ParticipantTest.php
tests/phpunit/api/v3/SettingTest.php
tests/phpunit/api/v3/SystemTest.php
tests/phpunit/api/v3/TagTest.php
tests/templates/documentFunction.tpl

index 45a46e0b56de5cf9d734036f5a5377bd29efc544..4f53c542fc0324b54e6361ee65a70ba28f963cc5 100644 (file)
@@ -105,7 +105,7 @@ function civicrm_error($result) {
 }
 
 /**
- * Get camel case version of entity or action name.
+ * Get camel case version of entity name.
  *
  * @param string|null $entity
  *
index 667f35181fb28861e9cf1a0a40cae07f5875e0be..6d9fba5541e0e3b759b2e050fde476466cdba148 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity Create API.
+ * Test Generated example demonstrating the Activity.create API.
  *
  * Demonstrates create with Contact Reference Custom Field.
  *
@@ -22,7 +22,7 @@ function activity_create_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'Create', $params);
+    $result = civicrm_api3('Activity', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -85,11 +85,10 @@ function activity_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityCreateCustomContactRefField
-* and can be found in
+* The test that created it is called "testActivityCreateCustomContactRefField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 987a3848f63f37eaa305d2a6cf65e1987c5ebb87..ec99659ff6a963d7fc8761968b1d937a29f458fb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity get API.
+ * Test Generated example demonstrating the Activity.get API.
  *
  * Get with Contact Ref Custom Field
  *
@@ -14,7 +14,7 @@ function activity_get_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'get', $params);
+    $result = civicrm_api3('Activity', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -73,11 +73,10 @@ function activity_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityCreateCustomContactRefField
-* and can be found in
+* The test that created it is called "testActivityCreateCustomContactRefField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 9fb931ea1886c688ab5f29ebce73172372ab03f3..ecb37836bb18a8ccd9af801e52dfff49dae27931 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity create API.
+ * Test Generated example demonstrating the Activity.create API.
  *
  * @return array
  *   API result array
@@ -20,7 +20,7 @@ function activity_create_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'create', $params);
+    $result = civicrm_api3('Activity', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -83,11 +83,10 @@ function activity_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityCreateCustom
-* and can be found in
+* The test that created it is called "testActivityCreateCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 7865edbb3553e1ecb534e85b2b51b21763634fff..2c9a0b4c3ed99022b8f70f6120cde1a12641dff6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity get API.
+ * Test Generated example demonstrating the Activity.get API.
  *
  * Demonstrates _high filter (at time of writing doesn't work if contact_id is set.
  *
@@ -15,7 +15,7 @@ function activity_get_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'get', $params);
+    $result = civicrm_api3('Activity', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -68,11 +68,10 @@ function activity_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFilterMaxDate
-* and can be found in
+* The test that created it is called "testGetFilterMaxDate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 1dd6ab34ee70aa48f0937f7d9b5566ad0969e6d1..eeb99152c94aeabb8d652b1c3b8b2f6d2b5e5f09 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity get API.
+ * Test Generated example demonstrating the Activity.get API.
  *
  * Demonstrates _low filter (at time of writing doesn't work if contact_id is set.
  *
@@ -14,7 +14,7 @@ function activity_get_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'get', $params);
+    $result = civicrm_api3('Activity', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -67,11 +67,10 @@ function activity_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFilterMaxDate
-* and can be found in
+* The test that created it is called "testGetFilterMaxDate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 9754a7adf02d1e9607da837d9d1d47f5bac6994b..f8c5be72ba5854ae560d2f4dec74d78d81c9e9c9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity delete API.
+ * Test Generated example demonstrating the Activity.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function activity_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'delete', $params);
+    $result = civicrm_api3('Activity', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function activity_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteActivity
-* and can be found in
+* The test that created it is called "testDeleteActivity"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 1c00faffa52faf63af3e57196f47e9188a7348c2..343a07b19dc8df4a8fd465a71ad08f0bb619c1e6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity get API.
+ * Test Generated example demonstrating the Activity.get API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function activity_get_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'get', $params);
+    $result = civicrm_api3('Activity', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function activity_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityGetContact_idCustom
-* and can be found in
+* The test that created it is called "testActivityGetContact_idCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
similarity index 98%
rename from api/v3/examples/Activity/Getfields.php
rename to api/v3/examples/Activity/GetFields.php
index 1f4e915adaa442c85ae2d351d85af5aec7bfa702..746daa6e407689ddfbf87c676c56f5191d06dfe9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity getfields API.
+ * Test Generated example demonstrating the Activity.getfields API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function activity_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'getfields', $params);
+    $result = civicrm_api3('Activity', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -352,11 +352,10 @@ function activity_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFields
-* and can be found in
+* The test that created it is called "testGetFields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index caf94adc747c13af33d4172928a068951aeae606..924922bb68b71a6d858854fb44ff94228bb2933e 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**
- * Test Generated example of using activity  API.
+ * Test Generated example demonstrating the Activity.create API.
  *
  * Demonstrates setting & retrieving activity target & source.
  *
  * @return array
  *   API result array
  */
-function activity__example() {
+function activity_create_example() {
   $params = array(
     'source_contact_id' => 1,
     'subject' => 'Make-it-Happen Meeting',
@@ -23,7 +23,7 @@ function activity__example() {
   );
 
   try{
-    $result = civicrm_api3('activity', '', $params);
+    $result = civicrm_api3('Activity', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,7 +46,7 @@ function activity__example() {
  * @return array
  *   API result array
  */
-function activity__expectedresult() {
+function activity_create_expectedresult() {
 
   $expectedResult = array(
     'is_error' => 0,
@@ -86,11 +86,10 @@ function activity__expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityReturnTargetAssignee
-* and can be found in
+* The test that created it is called "testActivityReturnTargetAssignee"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index 07ebf0479c8e80a20ad3fb68d64d931e8c5349c0..545793076c86c0996a92ffb464ee6fe1bfaf961b 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Test Generated example of using activity get API.
+ * Test Generated example demonstrating the Activity.get API.
  *
- * Demonstrates getting asignee_contact_id & using it to get the contact.
+ * Demonstrates getting assignee_contact_id & using it to get the contact.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function activity_get_example() {
   );
 
   try{
-    $result = civicrm_api3('activity', 'get', $params);
+    $result = civicrm_api3('Activity', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -150,11 +150,10 @@ function activity_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityGetGoodID1
-* and can be found in
+* The test that created it is called "testActivityGetGoodID1"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
 *
 * You can see the outcome of the API tests at
index bdf8db5033a73387e49d8fe7b13911a7465b18f7..5a0a7cb64a74e063973c6cdc5960103d91b7b01c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity_contact create API.
+ * Test Generated example demonstrating the ActivityContact.create API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function activity_contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('activity_contact', 'create', $params);
+    $result = civicrm_api3('ActivityContact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -56,11 +56,10 @@ function activity_contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateActivityContact
-* and can be found in
+* The test that created it is called "testCreateActivityContact"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityContactTest.php
 *
 * You can see the outcome of the API tests at
index 3ab9da06b80678f7919292d2fcf86aa171225762..7920498221c31f6a90e42f6322cdc53d47d98cc2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using activity_contact delete API.
+ * Test Generated example demonstrating the ActivityContact.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function activity_contact_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('activity_contact', 'delete', $params);
+    $result = civicrm_api3('ActivityContact', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function activity_contact_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteActivityContact
-* and can be found in
+* The test that created it is called "testDeleteActivityContact"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityContactTest.php
 *
 * You can see the outcome of the API tests at
index be4265deece779c16fa6d45a23985c484071f7c6..3fb68a21a6befe230295d06b532660a709f715d1 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /**
- * Test Generated example of using activity_type create API.
+ * Test Generated example demonstrating the ActivityType.create API.
  *
  * @deprecated
- * The activity_type api is deprecated. Please use the option_value api instead.
+ * The ActivityType api is deprecated. Please use the OptionValue api instead.
  *
  * @return array
  *   API result array
@@ -19,7 +19,7 @@ function activity_type_create_example() {
   );
 
   try{
-    $result = civicrm_api3('activity_type', 'create', $params);
+    $result = civicrm_api3('ActivityType', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -69,17 +69,16 @@ function activity_type_create_expectedresult() {
         'visibility_id' => '',
       ),
     ),
-    'deprecated' => 'The activity_type api is deprecated. Please use the option_value api instead.',
+    'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
   );
 
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityTypeCreate
-* and can be found in
+* The test that created it is called "testActivityTypeCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php
 *
 * You can see the outcome of the API tests at
index f914ae5b94ed8f1118ac530142e14d5d7a85bd4c..b6e93f75a9e553fe1d847b75280d4a36425f732a 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /**
- * Test Generated example of using activity_type get API.
+ * Test Generated example demonstrating the ActivityType.get API.
  *
  * @deprecated
- * The activity_type api is deprecated. Please use the option_value api instead.
+ * The ActivityType api is deprecated. Please use the OptionValue api instead.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function activity_type_get_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('activity_type', 'get', $params);
+    $result = civicrm_api3('ActivityType', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -93,17 +93,16 @@ function activity_type_get_expectedresult() {
       '49' => 'Downloaded Invoice',
       '50' => 'Emailed Invoice',
     ),
-    'deprecated' => 'The activity_type api is deprecated. Please use the option_value api instead.',
+    'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
   );
 
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityTypeGet
-* and can be found in
+* The test that created it is called "testActivityTypeGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php
 *
 * You can see the outcome of the API tests at
index eb1a856458c1b91d4fadd2cf0f71846c4b4bdd5b..87d490a69b8cf02dbad02b28da58a0f2515c3d70 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using address get API.
+ * Test Generated example demonstrating the Address.get API.
  *
  * Demonstrates Use of Like.
  *
@@ -16,7 +16,7 @@ function address_get_example() {
   );
 
   try{
-    $result = civicrm_api3('address', 'get', $params);
+    $result = civicrm_api3('Address', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -67,11 +67,10 @@ function address_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetAddressLikeSuccess
-* and can be found in
+* The test that created it is called "testGetAddressLikeSuccess"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
 *
 * You can see the outcome of the API tests at
index 64ac88c20df5523987b734a4dad299e3027ad7ce..4fb7dabc7c93f2433e58ffb73884be3acbeda727 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using address create API.
+ * Test Generated example demonstrating the Address.create API.
  *
  * Demonstrates Use of address parsing param.
  *
@@ -16,7 +16,7 @@ function address_create_example() {
   );
 
   try{
-    $result = civicrm_api3('address', 'create', $params);
+    $result = civicrm_api3('Address', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -66,11 +66,10 @@ function address_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateAddressParsing
-* and can be found in
+* The test that created it is called "testCreateAddressParsing"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
 *
 * You can see the outcome of the API tests at
index 8194916378ef2b8837b0f7d94a9ca4bf91058849..f8f82481d3ddd8829222c22b920a8b5b13a1eec1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using address get API.
+ * Test Generated example demonstrating the Address.get API.
  *
  * Demonstrates Use of sort filter.
  *
@@ -17,7 +17,7 @@ function address_get_example() {
   );
 
   try{
-    $result = civicrm_api3('address', 'get', $params);
+    $result = civicrm_api3('Address', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -81,11 +81,10 @@ function address_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetAddressSort
-* and can be found in
+* The test that created it is called "testGetAddressSort"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
 *
 * You can see the outcome of the API tests at
index 9c202a415a1b13854ac4ed3114d9005eec2ae64f..222a81ca509b8af20c640405374a867e6f1736f6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using address create API.
+ * Test Generated example demonstrating the Address.create API.
  *
  * @return array
  *   API result array
@@ -19,7 +19,7 @@ function address_create_example() {
   );
 
   try{
-    $result = civicrm_api3('address', 'create', $params);
+    $result = civicrm_api3('Address', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -70,11 +70,10 @@ function address_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateAddress
-* and can be found in
+* The test that created it is called "testCreateAddress"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
 *
 * You can see the outcome of the API tests at
index a2ea4376cd7e825bb28193aaf274dca77af0ef0c..993b11f91f8d2596bdba2f50ec0f4b372a870966 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using address delete API.
+ * Test Generated example demonstrating the Address.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function address_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('address', 'delete', $params);
+    $result = civicrm_api3('Address', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function address_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteAddress
-* and can be found in
+* The test that created it is called "testDeleteAddress"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
 *
 * You can see the outcome of the API tests at
index 8238fe1897ba74ab6b660cccd55a7dd78dcd6af7..a06342e1440fb4004d3b271495168504ce111758 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using address get API.
+ * Test Generated example demonstrating the Address.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function address_get_example() {
   );
 
   try{
-    $result = civicrm_api3('address', 'get', $params);
+    $result = civicrm_api3('Address', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -63,11 +63,10 @@ function address_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetAddress
-* and can be found in
+* The test that created it is called "testGetAddress"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/AddressTest.php
 *
 * You can see the outcome of the API tests at
diff --git a/api/v3/examples/Address/GetOptions.php b/api/v3/examples/Address/GetOptions.php
new file mode 100644 (file)
index 0000000..cfa88f4
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Test Generated example demonstrating the Address.getoptions API.
+ *
+ * @return array
+ *   API result array
+ */
+function address_getoptions_example() {
+  $params = array(
+    'field' => 'location_type_id',
+  );
+
+  try{
+    $result = civicrm_api3('Address', 'getoptions', $params);
+  }
+  catch (CiviCRM_API3_Exception $e) {
+    // Handle error here.
+    $errorMessage = $e->getMessage();
+    $errorCode = $e->getErrorCode();
+    $errorData = $e->getExtraParams();
+    return array(
+      'error' => $errorMessage,
+      'error_code' => $errorCode,
+      'error_data' => $errorData,
+    );
+  }
+
+  return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ *   API result array
+ */
+function address_getoptions_expectedresult() {
+
+  $expectedResult = array(
+    'is_error' => 0,
+    'version' => 3,
+    'count' => 5,
+    'values' => array(
+      '5' => 'Billing',
+      '1' => 'Home',
+      '3' => 'Main',
+      '4' => 'Other',
+      '2' => 'Work',
+    ),
+  );
+
+  return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testLocationTypeGet"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ConstantTest.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
+*/
index 213231bd9dae7986357c03ef339055d4e19885a7..c5d8f447af8972a4ca1e7fc70e04dc5342aed57d 100644 (file)
@@ -1,22 +1,22 @@
 <?php
 /**
- * Test Generated example of using batch create API.
+ * Test Generated example demonstrating the Batch.create API.
  *
  * @return array
  *   API result array
  */
 function batch_create_example() {
   $params = array(
-    'name' => 'New_Batch_03',
-    'title' => 'New Batch 03',
-    'description' => 'This is description for New Batch 03',
-    'total' => '300.33',
-    'item_count' => 3,
-    'status_id' => 1,
+    'name' => 'New_Batch_04',
+    'title' => 'New Batch 04',
+    'description' => 'This is description for New Batch 04',
+    'total' => '400.44',
+    'item_count' => 4,
+    'id' => 3,
   );
 
   try{
-    $result = civicrm_api3('batch', 'create', $params);
+    $result = civicrm_api3('Batch', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -45,23 +45,23 @@ function batch_create_expectedresult() {
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 2,
+    'id' => 3,
     'values' => array(
-      '2' => array(
-        'id' => '2',
-        'name' => 'New_Batch_03',
-        'title' => 'New Batch 03',
-        'description' => 'This is description for New Batch 03',
+      '3' => array(
+        'id' => '3',
+        'name' => 'New_Batch_04',
+        'title' => 'New Batch 04',
+        'description' => 'This is description for New Batch 04',
         'created_id' => '',
         'created_date' => '',
         'modified_id' => '',
-        'modified_date' => '2012-11-14 16:02:35',
+        'modified_date' => '',
         'saved_search_id' => '',
-        'status_id' => '1',
+        'status_id' => '',
         'type_id' => '',
         'mode_id' => '',
-        'total' => '300.33',
-        'item_count' => '3',
+        'total' => '400.44',
+        'item_count' => '4',
         'payment_instrument_id' => '',
         'exported_date' => '',
         'data' => '',
@@ -72,11 +72,10 @@ function batch_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testUpdate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
 *
 * You can see the outcome of the API tests at
index c2cb472713cbdf5ba791c3b2ee0a56d9fdf3b793..b97d5573b65dec5d8b01fa0095b864247051ae4f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using batch delete API.
+ * Test Generated example demonstrating the Batch.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function batch_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('batch', 'delete', $params);
+    $result = civicrm_api3('Batch', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function batch_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testBatchDeleteCorrectSyntax
-* and can be found in
+* The test that created it is called "testBatchDeleteCorrectSyntax"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
 *
 * You can see the outcome of the API tests at
index 7b22ce9ca275a228bde1b14016dfc98080f0ea9e..a0548bcaac1a1befed0b14ee896b1cbf25d878b5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using batch get API.
+ * Test Generated example demonstrating the Batch.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function batch_get_example() {
   );
 
   try{
-    $result = civicrm_api3('batch', 'get', $params);
+    $result = civicrm_api3('Batch', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -55,11 +55,10 @@ function batch_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
 *
 * You can see the outcome of the API tests at
index c365be272fa9ad695027d34d916bb88fd3d83892..ce04e6da89705aecac98ba2fdea5bcf96e467e84 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using campaign create API.
+ * Test Generated example demonstrating the Campaign.create API.
  *
  * Create a campaign - Note use of relative dates here:
  * @link http://www.php.net/manual/en/datetime.formats.relative.php.
@@ -16,7 +16,7 @@ function campaign_create_example() {
   );
 
   try{
-    $result = civicrm_api3('campaign', 'create', $params);
+    $result = civicrm_api3('Campaign', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -72,11 +72,10 @@ function campaign_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateCampaign
-* and can be found in
+* The test that created it is called "testCreateCampaign"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CampaignTest.php
 *
 * You can see the outcome of the API tests at
index bd00bfa5aa9a9c568bed0b1e5b9849f544e153d1..cff0043eb3469d1619967dff77cf542af0c8fdba 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using campaign delete API.
+ * Test Generated example demonstrating the Campaign.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function campaign_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('campaign', 'delete', $params);
+    $result = civicrm_api3('Campaign', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function campaign_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteCampaign
-* and can be found in
+* The test that created it is called "testDeleteCampaign"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CampaignTest.php
 *
 * You can see the outcome of the API tests at
index 417ff574df57e23c5f541f88bd7b823ca4221b7c..bfb051e1ba11f7b5a0120447db7e81d939e00e5b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using campaign get API.
+ * Test Generated example demonstrating the Campaign.get API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function campaign_get_example() {
   );
 
   try{
-    $result = civicrm_api3('campaign', 'get', $params);
+    $result = civicrm_api3('Campaign', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -58,11 +58,10 @@ function campaign_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetCampaign
-* and can be found in
+* The test that created it is called "testGetCampaign"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CampaignTest.php
 *
 * You can see the outcome of the API tests at
index f5047d6cd9600f51bb9019f209d54ba72a13568b..6bdab33e37a849e92b3a9f73fd5776a8a7b3c95e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using case create API.
+ * Test Generated example demonstrating the Case.create API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function case_create_example() {
   );
 
   try{
-    $result = civicrm_api3('case', 'create', $params);
+    $result = civicrm_api3('Case', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -60,11 +60,10 @@ function case_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCaseCreate
-* and can be found in
+* The test that created it is called "testCaseCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CaseTest.php
 *
 * You can see the outcome of the API tests at
index 96250780e55d82825c17b7a63b4ad3beb1730f2c..8655d1aad7bf6f68399ebaa56ad107339304ebf7 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /**
- * Test Generated example of using constant get API.
+ * Test Generated example demonstrating the Constant.get API.
  *
  * @deprecated
- * The constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.
+ * The Constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function constant_get_example() {
   );
 
   try{
-    $result = civicrm_api3('constant', 'get', $params);
+    $result = civicrm_api3('Constant', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -77,17 +77,16 @@ function constant_get_expectedresult() {
       '49' => 'Downloaded Invoice',
       '50' => 'Emailed Invoice',
     ),
-    'deprecated' => 'The constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.',
+    'deprecated' => 'The Constant api is deprecated as of CiviCRM 4.4. Please use the getoptions api action instead.',
   );
 
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testActivityType
-* and can be found in
+* The test that created it is called "testActivityType"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ConstantTest.php
 *
 * You can see the outcome of the API tests at
index 5c78e3cb6a48d7a2b2d6935f83568a3f8d9d3265..fe8e67a331905c077e577e045a42f40791d0c9ac 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates the usage of chained api functions.
  * In this case no notes or custom fields have been created.
@@ -20,7 +20,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -207,11 +207,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetIndividualWithChainedArrays
-* and can be found in
+* The test that created it is called "testGetIndividualWithChainedArrays"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index fcfd55808bcb981ff1a38dbc4773e59b2065e3f2..38792cba7c4582dc316097645ce43d2479351580 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates the usage of chained api functions.
  * In this case no notes or custom fields have been created.
@@ -21,7 +21,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -141,11 +141,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetIndividualWithChainedArraysFormats
-* and can be found in
+* The test that created it is called "testGetIndividualWithChainedArraysFormats"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 0b8778af6a6fc46ff053fa6a5214d0cc69bb477e..92ca2e0a00d990170bf4f0cb01dd4188092e0a1d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates the usage of chained api functions with multiple custom fields.
  *
@@ -18,7 +18,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -181,11 +181,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetIndividualWithChainedArraysAndMultipleCustom
-* and can be found in
+* The test that created it is called "testGetIndividualWithChainedArraysAndMultipleCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 66d9ac6463321d7453f286a7df8db881689aae8c..55a690da3153db64d7501f7b3ac62bb71ebb945f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
  *
  * This demonstrates the usage of chained api functions.  Specifically it has one 'parent function' &
  * 2 child functions - one receives values from the parent (Contact) and the other child (Tag).
@@ -23,7 +23,7 @@ function contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'create', $params);
+    $result = civicrm_api3('Contact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -118,11 +118,10 @@ function contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testChainingValuesCreate
-* and can be found in
+* The test that created it is called "testChainingValuesCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index b0da94256724aeb0d633b303fc369705b7b924ff..e2153adfd5973303a9235e38b87fc2e0b1653d6f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
  *
  * This demonstrates the syntax to create 2 chained entities.
  *
@@ -35,7 +35,7 @@ function contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'create', $params);
+    $result = civicrm_api3('Contact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -190,11 +190,10 @@ function contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateIndividualWithContributionDottedSyntax
-* and can be found in
+* The test that created it is called "testCreateIndividualWithContributionDottedSyntax"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index f9d8ba0bd3629933dc4622be7bb48e103782ba61..f17f204a2cfe4bf7d607e1fc8ec1924d89ef91ba 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
  *
  * Demonstrates creating two websites as an array.
  *
@@ -38,7 +38,7 @@ function contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'create', $params);
+    $result = civicrm_api3('Contact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -195,11 +195,10 @@ function contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateIndividualWithContributionChainedArrays
-* and can be found in
+* The test that created it is called "testCreateIndividualWithContributionChainedArrays"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 19d637bbd5df6685c8e58c37567983e1b55368da..5720faef5542269eac2d251732575c324d6594a3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
  *
  * This demonstrates setting a custom field through the API.
  *
@@ -16,7 +16,7 @@ function contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'create', $params);
+    $result = civicrm_api3('Contact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -104,11 +104,10 @@ function contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateWithCustom
-* and can be found in
+* The test that created it is called "testCreateWithCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
similarity index 93%
rename from api/v3/examples/Participant/CreateParticipantPayment.php
rename to api/v3/examples/Contact/CreateParticipantPayment.php
index d59db26a905eacc2aa23487b46452747b78aadb3..80021fa595a1d82b85255114007102dfbccc3c1b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant create API.
+ * Test Generated example demonstrating the Contact.create API.
  *
  * Single function to create contact with partipation & contribution.
  * Note that in the case of 'contribution' the 'create' is implied (api.contribution.create)
@@ -8,7 +8,7 @@
  * @return array
  *   API result array
  */
-function participant_create_example() {
+function contact_create_example() {
   $params = array(
     'contact_type' => 'Individual',
     'display_name' => 'dlobo',
@@ -30,7 +30,7 @@ function participant_create_example() {
   );
 
   try{
-    $result = civicrm_api3('participant', 'create', $params);
+    $result = civicrm_api3('Contact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -53,7 +53,7 @@ function participant_create_example() {
  * @return array
  *   API result array
  */
-function participant_create_expectedresult() {
+function contact_create_expectedresult() {
 
   $expectedResult = array(
     'is_error' => 0,
@@ -133,11 +133,10 @@ function participant_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateParticipantWithPayment
-* and can be found in
+* The test that created it is called "testCreateParticipantWithPayment"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
 *
 * You can see the outcome of the API tests at
index 7985aa8438f5bcdffd1d8562b42ba4678d7c2109..6dc057cffdf355ce185199c8d76ae8c51074789c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates setting a custom field through the API.
  *
@@ -14,7 +14,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -57,11 +57,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetWithCustom
-* and can be found in
+* The test that created it is called "testGetWithCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 7538f64fa995858bc85c9ab29d3c588df531c04a..3e2ac2ee3a831fbec60fc945107735d90df6b9d9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates setting a custom field through the API.
  *
@@ -14,7 +14,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -57,11 +57,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetWithCustomReturnSyntax
-* and can be found in
+* The test that created it is called "testGetWithCustomReturnSyntax"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index bf63bac717024cad82f3b909b1e9328bc856b446..47571b5dda14e1d952952e9ccadac3274d8c18ea 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact delete API.
+ * Test Generated example demonstrating the Contact.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contact_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'delete', $params);
+    $result = civicrm_api3('Contact', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function contact_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactDelete
-* and can be found in
+* The test that created it is called "testContactDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 48baa5f77d7519a48495a031918b182e40d7fd09..6f342d00ed8d96dac0182b85c983b336d2a821e3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact create API.
+ * Test Generated example demonstrating the Contact.create API.
  *
  * This demonstrates use of the 'format.is_success' param.
  * This param causes only the success or otherwise of the function to be returned as BOOLEAN
@@ -15,7 +15,7 @@ function contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'create', $params);
+    $result = civicrm_api3('Contact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -45,11 +45,10 @@ function contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactCreateFormatIsSuccessFalse
-* and can be found in
+* The test that created it is called "testContactCreateFormatIsSuccessFalse"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index fa0c11fcd1cdcb85eab3af4348f343cac208a51a..09a9febca027252f1a5dd35ae87298bdaf632c00 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates use of the 'format.is_success' param.
  * This param causes only the success or otherwise of the function to be returned as BOOLEAN
@@ -15,7 +15,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -45,11 +45,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactGetFormatIsSuccessTrue
-* and can be found in
+* The test that created it is called "testContactGetFormatIsSuccessTrue"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 843055349c112d5ef159a9ed661316b3f463a67c..fa74cbafd61689f04894f992ca15830004c87d05 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * This demonstrates use of the 'format.id_only' param.
  * This param causes the id of the only entity to be returned as an integer.
@@ -16,7 +16,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactGetFormatIDOnly
-* and can be found in
+* The test that created it is called "testContactGetFormatIDOnly"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 587b621c2f6959175509fd6584bf9af96f016d7d..5dea4811170e4ef8c7e82aae20d637bd713758cf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact getvalue API.
+ * Test Generated example demonstrating the Contact.getvalue API.
  *
  * This demonstrates use of the 'format.single_value' param.
  * This param causes only a single value of the only entity to be returned as an string.
@@ -16,7 +16,7 @@ function contact_getvalue_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'getvalue', $params);
+    $result = civicrm_api3('Contact', 'getvalue', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function contact_getvalue_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactGetFormatSingleValue
-* and can be found in
+* The test that created it is called "testContactGetFormatSingleValue"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 7f18069ada8a35f1f2d91fee3d8dda66a30388da..79be6cea475214bb6026c5583cfbb17e6783aabe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -116,11 +116,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactGetEmail
-* and can be found in
+* The test that created it is called "testContactGetEmail"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index e5bc1e9968594fe1be7d75495ec48f1dae843466..f12c3fac94c81cbd28c1d8acd7d3ac0cc95f59f0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact getactions API.
+ * Test Generated example demonstrating the Contact.getactions API.
  *
  * Getting the available actions for an entity.
  *
@@ -11,7 +11,7 @@ function contact_getactions_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('contact', 'getactions', $params);
+    $result = civicrm_api3('Contact', 'getactions', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -39,26 +39,31 @@ function contact_getactions_expectedresult() {
   $expectedResult = array(
     'is_error' => 0,
     'version' => 3,
-    'count' => 18,
+    'count' => 23,
     'values' => array(
       '0' => 'create',
       '1' => 'delete',
-      '2' => 'get',
-      '3' => 'getactions',
-      '4' => 'getcount',
-      '5' => 'getfields',
-      '6' => 'getlist',
-      '7' => 'getoptions',
-      '8' => 'getquick',
-      '9' => 'getrefcount',
-      '10' => 'getsingle',
-      '11' => 'getstat',
-      '12' => 'getvalue',
-      '13' => 'merge',
-      '14' => 'proximity',
-      '15' => 'replace',
-      '16' => 'setvalue',
-      '17' => 'update',
+      '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',
     ),
     'deprecated' => array(
       'getquick' => 'The "getquick" action is deprecated in favor of "getlist".',
@@ -69,11 +74,10 @@ function contact_getactions_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetActions
-* and can be found in
+* The test that created it is called "testGetActions"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 17be29dd0cbf4b7df36d584386bcad90e70eae05..724616b3e58532675a86e7dca30d8c7c9fed1076 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact getcount API.
+ * Test Generated example demonstrating the Contact.getcount API.
  *
  * This demonstrates use of the 'getCount' action.
  * This param causes the count of the only function to be returned as an integer.
@@ -14,7 +14,7 @@ function contact_getcount_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'getcount', $params);
+    $result = civicrm_api3('Contact', 'getcount', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -44,11 +44,10 @@ function contact_getcount_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactGetFormatCountOnly
-* and can be found in
+* The test that created it is called "testContactGetFormatCountOnly"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index bbca0bac69190b341d9bd43cb468e552986a933e..d45717fe3711f9fbcfb90576138a6b77c2df4229 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact GetFields API.
+ * Test Generated example demonstrating the Contact.getfields API.
  *
  * Demonstrates retrieving metadata with custom field options.
  *
@@ -16,7 +16,7 @@ function contact_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'GetFields', $params);
+    $result = civicrm_api3('Contact', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -770,11 +770,10 @@ function contact_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomFieldCreateWithOptionValues
-* and can be found in
+* The test that created it is called "testCustomFieldCreateWithOptionValues"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
similarity index 86%
rename from api/v3/examples/Contact/Getoptions.php
rename to api/v3/examples/Contact/GetOptions.php
index 93ddaa1446345d2aa01060ea955d3ed6d648392c..f485f5a400f61302587bf19637f59b7678608646 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact getoptions API.
+ * Test Generated example demonstrating the Contact.getoptions API.
  *
  * Demonstrates retrieving options for a custom field.
  *
@@ -13,7 +13,7 @@ function contact_getoptions_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'getoptions', $params);
+    $result = civicrm_api3('Contact', 'getoptions', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -51,11 +51,10 @@ function contact_getoptions_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomFieldCreateWithOptionValues
-* and can be found in
+* The test that created it is called "testCustomFieldCreateWithOptionValues"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 6642adce2d27bcf39d11fd7a1ca7dd59ac2de17e..1c202ab54ecb332e1c04b71a82e9e4d460714efa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact getsingle API.
+ * Test Generated example demonstrating the Contact.getsingle API.
  *
  * This demonstrates use of the 'format.single_entity_array' param.
  * This param causes the only contact to be returned as an array without the other levels.
@@ -15,7 +15,7 @@ function contact_getsingle_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'getsingle', $params);
+    $result = civicrm_api3('Contact', 'getsingle', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -112,11 +112,10 @@ function contact_getsingle_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactGetSingleEntityArray
-* and can be found in
+* The test that created it is called "testContactGetSingleEntityArray"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
index 3e721bc417f9effaddfebf4d32e285942e052552..f821db1fc03cc30991c4753208670f5f2fd38547 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contact get API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * Get all from group and display contacts.
  *
@@ -17,7 +17,7 @@ function contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'get', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -122,11 +122,10 @@ function contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetGroupIDFromContact
-* and can be found in
+* The test that created it is called "testGetGroupIDFromContact"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at
similarity index 96%
rename from api/v3/examples/Email/NestedReplaceEmail.php
rename to api/v3/examples/Contact/NestedReplaceEmail.php
index d8a827d80d55764c5912d4c90f9f6c0208b15a28..549c40bd52ba485c1080c4523c4c122cc2c1321a 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**
- * Test Generated example of using email replace API.
+ * Test Generated example demonstrating the Contact.get API.
  *
  * Demonstrates use of Replace in a nested API call.
  *
  * @return array
  *   API result array
  */
-function email_replace_example() {
+function contact_get_example() {
   $params = array(
     'id' => 10,
     'api.email.replace' => array(
@@ -42,7 +42,7 @@ function email_replace_example() {
   );
 
   try{
-    $result = civicrm_api3('email', 'replace', $params);
+    $result = civicrm_api3('Contact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,7 +65,7 @@ function email_replace_example() {
  * @return array
  *   API result array
  */
-function email_replace_expectedresult() {
+function contact_get_expectedresult() {
 
   $expectedResult = array(
     'is_error' => 0,
@@ -224,11 +224,10 @@ function email_replace_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testReplaceEmailsInChain
-* and can be found in
+* The test that created it is called "testReplaceEmailsInChain"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
 *
 * You can see the outcome of the API tests at
index c4c2f0ccde9a82d7dcde716e3fff25c4ce6caf66..fe6ec8ee0965bb9f6da8fbf60eb5e5111c5a4a33 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution create API.
+ * Test Generated example demonstrating the Contribution.create API.
  *
  * Demonstrates creating contribution with Soft Credit by passing in honor_contact_id.
  *
@@ -22,7 +22,7 @@ function contribution_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'create', $params);
+    $result = civicrm_api3('Contribution', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -90,11 +90,10 @@ function contribution_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionWithHonoreeContact
-* and can be found in
+* The test that created it is called "testCreateContributionWithHonoreeContact"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
 *
 * You can see the outcome of the API tests at
index ed1a02846d9053801a76e6b03ce2cd5cfbbb7cc5..4a19762036ba1bc554ec2c46587aa2fe201b9b6c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution create API.
+ * Test Generated example demonstrating the Contribution.create API.
  *
  * Demonstrates creating contribution with Note Entity.
  *
@@ -25,7 +25,7 @@ function contribution_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'create', $params);
+    $result = civicrm_api3('Contribution', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -93,11 +93,10 @@ function contribution_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionWithNote
-* and can be found in
+* The test that created it is called "testCreateContributionWithNote"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
 *
 * You can see the outcome of the API tests at
index eb0e94e79a22b5aa70237f38abde8b157239b898..f756efed96d3a6ae173e61c0402dda2fdc13ec3e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution create API.
+ * Test Generated example demonstrating the Contribution.create API.
  *
  * Demonstrates creating contribution with SoftCredit.
  *
@@ -28,7 +28,7 @@ function contribution_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'create', $params);
+    $result = civicrm_api3('Contribution', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -96,11 +96,10 @@ function contribution_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionWithSoftCredit
-* and can be found in
+* The test that created it is called "testCreateContributionWithSoftCredit"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
 *
 * You can see the outcome of the API tests at
index 51f2acb6d37856189463f72d1ab3755984d13509..8d7126cb897de7c0f5218e7f9f9b630623beca52 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution create API.
+ * Test Generated example demonstrating the Contribution.create API.
  *
  * Demonstrates creating contribution with Soft Credit defaults for amount and type.
  *
@@ -22,7 +22,7 @@ function contribution_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'create', $params);
+    $result = civicrm_api3('Contribution', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -90,11 +90,10 @@ function contribution_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionWithSoftCreditDefaults
-* and can be found in
+* The test that created it is called "testCreateContributionWithSoftCreditDefaults"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
 *
 * You can see the outcome of the API tests at
index 1875f49d4da9c54db731c21a7ac813521586ac31..55f4582cc44304d7a2d3eca56422555f86da414c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution create API.
+ * Test Generated example demonstrating the Contribution.create API.
  *
  * @return array
  *   API result array
@@ -19,7 +19,7 @@ function contribution_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'create', $params);
+    $result = civicrm_api3('Contribution', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -87,12 +87,11 @@ function contribution_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionPendingOnline
-* and can be found in
-* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
+* The test that created it is called "testCreateContributionPendingOnline"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.php
 *
 * You can see the outcome of the API tests at
 * https://test.civicrm.org/job/CiviCRM-master-git/
index 3056cfc1dc02111c07c5c0ea0c5f61108a5b860b..2c7234e41960bd60f593ba2c0930633821c4eb66 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution create API.
+ * Test Generated example demonstrating the Contribution.create API.
  *
  * Create Contribution with Nested Line Items.
  *
@@ -9,14 +9,10 @@
  */
 function contribution_create_example() {
   $params = array(
-    'contact_id' => 9,
+    'contact_id' => 1,
     'receive_date' => '20120511',
-    'total_amount' => '100',
-    'financial_type_id' => 1,
-    'payment_instrument_id' => 1,
-    'non_deductible_amount' => '10',
-    'fee_amount' => '50',
-    'net_amount' => '90',
+    'total_amount' => '400',
+    'financial_type_id' => 7,
     'trxn_id' => 12345,
     'invoice_id' => 67890,
     'source' => 'SSF',
@@ -24,22 +20,28 @@ function contribution_create_example() {
     'skipLineItem' => 1,
     'api.line_item.create' => array(
       '0' => array(
-        'price_field_id' => 1,
-        'qty' => 2,
-        'line_total' => '20',
-        'unit_price' => '10',
+        'price_field_id' => array(
+          '0' => 3,
+        ),
+        'qty' => 1,
+        'line_total' => '100',
+        'unit_price' => '100',
+        'financial_type_id' => 7,
       ),
       '1' => array(
-        'price_field_id' => 1,
+        'price_field_id' => array(
+          '0' => 3,
+        ),
         'qty' => 1,
-        'line_total' => '80',
-        'unit_price' => '80',
+        'line_total' => '300',
+        'unit_price' => '300',
+        'financial_type_id' => 8,
       ),
     ),
   );
 
   try{
-    $result = civicrm_api3('contribution', 'create', $params);
+    $result = civicrm_api3('Contribution', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -72,15 +74,15 @@ function contribution_create_expectedresult() {
     'values' => array(
       '1' => array(
         'id' => '1',
-        'contact_id' => '9',
-        'financial_type_id' => '1',
+        'contact_id' => '1',
+        'financial_type_id' => '7',
         'contribution_page_id' => '',
-        'payment_instrument_id' => '1',
+        'payment_instrument_id' => '4',
         'receive_date' => '20120511000000',
-        'non_deductible_amount' => '10',
-        'total_amount' => '100',
-        'fee_amount' => '50',
-        'net_amount' => '90',
+        'non_deductible_amount' => '',
+        'total_amount' => '435',
+        'fee_amount' => 0,
+        'net_amount' => '435',
         'trxn_id' => '12345',
         'invoice_id' => '67890',
         'currency' => 'USD',
@@ -98,8 +100,8 @@ function contribution_create_expectedresult() {
         'check_number' => '',
         'campaign_id' => '',
         'creditnote_id' => '',
-        'tax_amount' => 0,
-        'contribution_type_id' => '1',
+        'tax_amount' => '35',
+        'contribution_type_id' => '7',
         'api.line_item.create' => array(
           '0' => array(
             'is_error' => 0,
@@ -112,16 +114,18 @@ function contribution_create_expectedresult() {
                 'entity_table' => 'civicrm_contribution',
                 'entity_id' => '1',
                 'contribution_id' => '1',
-                'price_field_id' => '1',
+                'price_field_id' => array(
+                  '0' => '3',
+                ),
                 'label' => 'line item',
-                'qty' => '2',
-                'unit_price' => '10',
-                'line_total' => '20',
+                'qty' => '1',
+                'unit_price' => '100',
+                'line_total' => '100',
                 'participant_count' => '',
                 'price_field_value_id' => '',
-                'financial_type_id' => '',
+                'financial_type_id' => '7',
                 'deductible_amount' => '',
-                'tax_amount' => '',
+                'tax_amount' => '20',
               ),
             ),
           ),
@@ -136,16 +140,18 @@ function contribution_create_expectedresult() {
                 'entity_table' => 'civicrm_contribution',
                 'entity_id' => '1',
                 'contribution_id' => '1',
-                'price_field_id' => '1',
+                'price_field_id' => array(
+                  '0' => '3',
+                ),
                 'label' => 'line item',
                 'qty' => '1',
-                'unit_price' => '80',
-                'line_total' => '80',
+                'unit_price' => '300',
+                'line_total' => '300',
                 'participant_count' => '',
                 'price_field_value_id' => '',
-                'financial_type_id' => '',
+                'financial_type_id' => '8',
                 'deductible_amount' => '',
-                'tax_amount' => '',
+                'tax_amount' => '15',
               ),
             ),
           ),
@@ -157,12 +163,11 @@ function contribution_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionChainedLineItems
-* and can be found in
-* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
+* The test that created it is called "testCreateContributionChainedLineItems"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.php
 *
 * You can see the outcome of the API tests at
 * https://test.civicrm.org/job/CiviCRM-master-git/
index 9617d619b2d15d5ca8b88b952bcb2d085752b0d9..0242584211948b8bebf064b1001ca75c115a69f0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution delete API.
+ * Test Generated example demonstrating the Contribution.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'delete', $params);
+    $result = civicrm_api3('Contribution', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -49,12 +49,11 @@ function contribution_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteContribution
-* and can be found in
-* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
+* The test that created it is called "testDeleteContribution"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TaxContributionPageTest.php
 *
 * You can see the outcome of the API tests at
 * https://test.civicrm.org/job/CiviCRM-master-git/
index d5abc40e06564b8c4150a1ca93734d8617734940..3649403beaa74b45d8ac2445d60e2b0e523b7187 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution get API.
+ * Test Generated example demonstrating the Contribution.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution', 'get', $params);
+    $result = civicrm_api3('Contribution', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -97,11 +97,10 @@ function contribution_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetContributionLegacyBehaviour
-* and can be found in
+* The test that created it is called "testGetContributionLegacyBehaviour"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionTest.php
 *
 * You can see the outcome of the API tests at
index ff0ae575dcc1259309131d2342bdc497ee8fd627..3da279757f7ce3d03d77b84461c04f3cbedc7230 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_page create API.
+ * Test Generated example demonstrating the ContributionPage.create API.
  *
  * @return array
  *   API result array
@@ -16,7 +16,7 @@ function contribution_page_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_page', 'create', $params);
+    $result = civicrm_api3('ContributionPage', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -101,11 +101,10 @@ function contribution_page_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionPage
-* and can be found in
+* The test that created it is called "testCreateContributionPage"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
 *
 * You can see the outcome of the API tests at
index 699dc5f7990cdd18652c5e959ee74992ce8566cf..d151e916c9ba816ceab59a187a656869e9c88396 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_page delete API.
+ * Test Generated example demonstrating the ContributionPage.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_page_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_page', 'delete', $params);
+    $result = civicrm_api3('ContributionPage', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function contribution_page_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteContributionPage
-* and can be found in
+* The test that created it is called "testDeleteContributionPage"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
 *
 * You can see the outcome of the API tests at
index e55154bdc630ecae876a2a204e0e41b7a4614841..fb11aac0f5eee60d1fcf84b7cdd99ca1607af6e2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_page get API.
+ * Test Generated example demonstrating the ContributionPage.get API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function contribution_page_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_page', 'get', $params);
+    $result = civicrm_api3('ContributionPage', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -72,11 +72,10 @@ function contribution_page_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetContributionPageByAmount
-* and can be found in
+* The test that created it is called "testGetContributionPageByAmount"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
 *
 * You can see the outcome of the API tests at
index 5dab053aadbd1c62477717606240389e27e000bd..aa5605270316a256be91287c85971e083115a95a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_page Submit API.
+ * Test Generated example demonstrating the ContributionPage.submit API.
  *
  * submit contribution page
  *
@@ -33,7 +33,7 @@ function contribution_page_submit_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_page', 'Submit', $params);
+    $result = civicrm_api3('ContributionPage', 'submit', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -68,11 +68,10 @@ function contribution_page_submit_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed
-* and can be found in
+* The test that created it is called "testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionPageTest.php
 *
 * You can see the outcome of the API tests at
index 90935966f980259efc0e6cf2be1718d41c19d757..be1c2685587a8a790fdafbe1f67840321fbaeda5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_recur create API.
+ * Test Generated example demonstrating the ContributionRecur.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function contribution_recur_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_recur', 'create', $params);
+    $result = civicrm_api3('ContributionRecur', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -84,11 +84,10 @@ function contribution_recur_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionRecur
-* and can be found in
+* The test that created it is called "testCreateContributionRecur"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
 *
 * You can see the outcome of the API tests at
index 7f18509c6238471b012b56eb0d491d2e6be1ac35..872109876597ba043700c59bd8c105092a6b6de8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_recur delete API.
+ * Test Generated example demonstrating the ContributionRecur.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_recur_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_recur', 'delete', $params);
+    $result = civicrm_api3('ContributionRecur', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function contribution_recur_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteContributionRecur
-* and can be found in
+* The test that created it is called "testDeleteContributionRecur"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
 *
 * You can see the outcome of the API tests at
index 9c1f88b939a9b4d5664ebe8ffca8645f3e8aaaaf..df8b9ff1a0d85bf1cf12177ea61cb82e0046cfe6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_recur get API.
+ * Test Generated example demonstrating the ContributionRecur.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_recur_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_recur', 'get', $params);
+    $result = civicrm_api3('ContributionRecur', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function contribution_recur_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetContributionRecur
-* and can be found in
+* The test that created it is called "testGetContributionRecur"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionRecurTest.php
 *
 * You can see the outcome of the API tests at
index 74eb2d1268735ec8817920166d00c791f0ffd916..d88953f94f17cf8631fbd93f19491134d92028b3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_soft create API.
+ * Test Generated example demonstrating the ContributionSoft.create API.
  *
  * @return array
  *   API result array
@@ -15,7 +15,7 @@ function contribution_soft_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_soft', 'create', $params);
+    $result = civicrm_api3('ContributionSoft', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -64,11 +64,10 @@ function contribution_soft_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionSoft
-* and can be found in
+* The test that created it is called "testCreateContributionSoft"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
 *
 * You can see the outcome of the API tests at
index ff180dcfd36ec480c09274af33a0141db742e5bd..64dd7b371bd465cfb47deb79e6125d55162a2c73 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_soft delete API.
+ * Test Generated example demonstrating the ContributionSoft.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_soft_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_soft', 'delete', $params);
+    $result = civicrm_api3('ContributionSoft', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -41,11 +41,10 @@ function contribution_soft_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteContributionSoft
-* and can be found in
+* The test that created it is called "testDeleteContributionSoft"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
 *
 * You can see the outcome of the API tests at
index 4f202c5b0004b00db6a9c6c9c79ac1ef5e5ccafb..1cf28d1bf184436f200e41bd120b9b91558091ff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_soft get API.
+ * Test Generated example demonstrating the ContributionSoft.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function contribution_soft_get_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_soft', 'get', $params);
+    $result = civicrm_api3('ContributionSoft', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -57,11 +57,10 @@ function contribution_soft_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetContributionSoft
-* and can be found in
+* The test that created it is called "testGetContributionSoft"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
 *
 * You can see the outcome of the API tests at
index a5a3472ea7604c1696e3b2d64b16f2ce4c2f6aa3..eb9feefeaec8989f2f89dda16da17df9c26c6688 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using country create API.
+ * Test Generated example demonstrating the Country.create API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function country_create_example() {
   );
 
   try{
-    $result = civicrm_api3('country', 'create', $params);
+    $result = civicrm_api3('Country', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,11 +61,10 @@ function country_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateCountry
-* and can be found in
+* The test that created it is called "testCreateCountry"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CountryTest.php
 *
 * You can see the outcome of the API tests at
index 9002447ea300a4cc41cff7a69c5a2e4cba90ed1b..5482903bb8c7796cbd671fe3d0bc886a7e5c14b0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using country delete API.
+ * Test Generated example demonstrating the Country.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function country_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('country', 'delete', $params);
+    $result = civicrm_api3('Country', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function country_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteCountry
-* and can be found in
+* The test that created it is called "testDeleteCountry"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CountryTest.php
 *
 * You can see the outcome of the API tests at
index a3630300c647754b1871155a3293cd979e9528bd..5b72473981b7255eaf79303049c4fa69b2b8be65 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using country get API.
+ * Test Generated example demonstrating the Country.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function country_get_example() {
   );
 
   try{
-    $result = civicrm_api3('country', 'get', $params);
+    $result = civicrm_api3('Country', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -55,11 +55,10 @@ function country_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CountryTest.php
 *
 * You can see the outcome of the API tests at
index f8e91c0bfada76cfe6c79a8718622de886b71f19..3e98f5c8b00d1c00541e49164144898a7773707d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_field create API.
+ * Test Generated example demonstrating the CustomField.create API.
  *
  * @return array
  *   API result array
@@ -20,7 +20,7 @@ function custom_field_create_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_field', 'create', $params);
+    $result = civicrm_api3('CustomField', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -89,11 +89,10 @@ function custom_field_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomFieldCreateWithEdit
-* and can be found in
+* The test that created it is called "testCustomFieldCreateWithEdit"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomFieldTest.php
 *
 * You can see the outcome of the API tests at
index 56486b4b40e7d36e583abfdcf7b3b16d96c18a92..df553d692930f4a42360d3ab0effe552a4655d2d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_field delete API.
+ * Test Generated example demonstrating the CustomField.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function custom_field_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_field', 'delete', $params);
+    $result = civicrm_api3('CustomField', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function custom_field_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomFieldDelete
-* and can be found in
+* The test that created it is called "testCustomFieldDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomFieldTest.php
 *
 * You can see the outcome of the API tests at
index aef2727f030093bc8bf598c3fafd9d00b0dd69ad..fe3b7e950d48fc140180ddbda01b66b8c2a9ec7d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_group create API.
+ * Test Generated example demonstrating the CustomGroup.create API.
  *
  * @return array
  *   API result array
@@ -21,7 +21,7 @@ function custom_group_create_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_group', 'create', $params);
+    $result = civicrm_api3('CustomGroup', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -80,11 +80,10 @@ function custom_group_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomGroupCreate
-* and can be found in
+* The test that created it is called "testCustomGroupCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomGroupTest.php
 *
 * You can see the outcome of the API tests at
index 48f15dce2dbd2fd615ec1766b83a4d332985a003..429be45180909d76ca0903b2abfaa57fcc15cb55 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_group delete API.
+ * Test Generated example demonstrating the CustomGroup.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function custom_group_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_group', 'delete', $params);
+    $result = civicrm_api3('CustomGroup', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function custom_group_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomGroupDelete
-* and can be found in
+* The test that created it is called "testCustomGroupDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomGroupTest.php
 *
 * You can see the outcome of the API tests at
index 4c6557e97e69586ce2a85a1c90f235a1947e0ee4..6477dd985f247bdadf02b34e0475184f84560d9d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_group get API.
+ * Test Generated example demonstrating the CustomGroup.get API.
  *
  * @return array
  *   API result array
@@ -9,7 +9,7 @@ function custom_group_get_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('custom_group', 'get', $params);
+    $result = civicrm_api3('CustomGroup', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -62,11 +62,10 @@ function custom_group_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetCustomGroupSuccess
-* and can be found in
+* The test that created it is called "testGetCustomGroupSuccess"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomGroupTest.php
 *
 * You can see the outcome of the API tests at
index 4a1a1045749a75d234e2b00f13b43601b65f3ace..f53d3a0f18c4b7da4f51741a1d6fe4b3ff77fd14 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_value create API.
+ * Test Generated example demonstrating the CustomValue.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function custom_value_create_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_value', 'create', $params);
+    $result = civicrm_api3('CustomValue', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,11 +47,10 @@ function custom_value_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateCustomValue
-* and can be found in
+* The test that created it is called "testCreateCustomValue"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
 *
 * You can see the outcome of the API tests at
similarity index 92%
rename from api/v3/examples/CustomValue/formatFieldName.php
rename to api/v3/examples/CustomValue/FormatFieldName.php
index bedcc01718e595d6c2319e09c0bcb7a52be2c3b9..8aab39ddf9ca032eb8bbd76f6368f6ff9cf2e90d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_value get API.
+ * Test Generated example demonstrating the CustomValue.get API.
  *
  * utilises field names
  *
@@ -15,7 +15,7 @@ function custom_value_get_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_value', 'get', $params);
+    $result = civicrm_api3('CustomValue', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -98,11 +98,10 @@ function custom_value_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetMultipleCustomValues
-* and can be found in
+* The test that created it is called "testGetMultipleCustomValues"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
 *
 * You can see the outcome of the API tests at
index caa77d0a7a2e427c26efcc341c2c11fa12320b95..578f5a3e51471b1b1597de1d6011ba1a0f8977d9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using custom_value get API.
+ * Test Generated example demonstrating the CustomValue.get API.
  *
  * This demonstrates the use of CustomValue get to fetch single and multi-valued custom data.
  *
@@ -14,7 +14,7 @@ function custom_value_get_example() {
   );
 
   try{
-    $result = civicrm_api3('custom_value', 'get', $params);
+    $result = civicrm_api3('CustomValue', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -97,11 +97,10 @@ function custom_value_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetMultipleCustomValues
-* and can be found in
+* The test that created it is called "testGetMultipleCustomValues"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
 *
 * You can see the outcome of the API tests at
index d200df72badd643247bb9d98e7c0f932e4c99556..0ab3c81451cea484378b5956625c161dfd76f9ce 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using domain create API.
+ * Test Generated example demonstrating the Domain.create API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function domain_create_example() {
   );
 
   try{
-    $result = civicrm_api3('domain', 'create', $params);
+    $result = civicrm_api3('Domain', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,11 +61,10 @@ function domain_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
 *
 * You can see the outcome of the API tests at
index 2b59267aac4ddf9b2c7a032e003cf991773cd58b..f1f753f57d0aec0ed814f199544703292958bc65 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using domain get API.
+ * Test Generated example demonstrating the Domain.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function domain_get_example() {
   );
 
   try{
-    $result = civicrm_api3('domain', 'get', $params);
+    $result = civicrm_api3('Domain', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -98,11 +98,10 @@ function domain_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/DomainTest.php
 *
 * You can see the outcome of the API tests at
index b346a069b11d9e03fdc8874c3783334ae6e60323..71e56b9ab47c3e7f2c3e9b05ed3ad30ef4b3dd57 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using email create API.
+ * Test Generated example demonstrating the Email.create API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function email_create_example() {
   );
 
   try{
-    $result = civicrm_api3('email', 'create', $params);
+    $result = civicrm_api3('Email', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function email_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateEmail
-* and can be found in
+* The test that created it is called "testCreateEmail"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
 *
 * You can see the outcome of the API tests at
index 41f84f9edcf46bb6d30c7e6f9e8895775c52501a..2c2b3e2b582dee5d3969ba863a7e271eee3be5d0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using email delete API.
+ * Test Generated example demonstrating the Email.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function email_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('email', 'delete', $params);
+    $result = civicrm_api3('Email', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function email_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteEmail
-* and can be found in
+* The test that created it is called "testDeleteEmail"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
 *
 * You can see the outcome of the API tests at
index d031d33d7a868c24c0bd8c272cdd6b2ecfa5b28d..74654ade260be09a9bf7d2e3122adc150b262985 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using email replace API.
+ * Test Generated example demonstrating the Email.replace API.
  *
  * @return array
  *   API result array
@@ -38,7 +38,7 @@ function email_replace_example() {
   );
 
   try{
-    $result = civicrm_api3('email', 'replace', $params);
+    $result = civicrm_api3('Email', 'replace', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -144,11 +144,10 @@ function email_replace_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testReplaceEmail
-* and can be found in
+* The test that created it is called "testReplaceEmail"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EmailTest.php
 *
 * You can see the outcome of the API tests at
index f0b4f12a73028ed8aaec9e7d97d3a2637195c408..e114b9fbe60189c7ed945c705060ffd28955387c 100644 (file)
@@ -1,18 +1,18 @@
 <?php
 /**
- * Test Generated example of using entity_tag create API.
+ * Test Generated example demonstrating the EntityTag.create API.
  *
  * @return array
  *   API result array
  */
 function entity_tag_create_example() {
   $params = array(
-    'contact_id' => 12,
-    'tag_id' => '9',
+    'contact_id' => 3,
+    'tag_id' => '6',
   );
 
   try{
-    $result = civicrm_api3('entity_tag', 'create', $params);
+    $result = civicrm_api3('EntityTag', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,11 +47,10 @@ function entity_tag_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testContactEntityTagCreate
-* and can be found in
+* The test that created it is called "testIndividualEntityTagGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityTagTest.php
 *
 * You can see the outcome of the API tests at
index d07a39b33b0c8612c71b5b2363e17dfc67e11771..faecc36c6d600bfba4894872a43bc89093a8529e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using entity_tag delete API.
+ * Test Generated example demonstrating the EntityTag.delete API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function entity_tag_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('entity_tag', 'delete', $params);
+    $result = civicrm_api3('EntityTag', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,11 +47,10 @@ function entity_tag_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testEntityTagDeleteHH
-* and can be found in
+* The test that created it is called "testEntityTagDeleteHH"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityTagTest.php
 *
 * You can see the outcome of the API tests at
index c2cdb70fa82342f62fcc7ce03d4ad85a394b086c..aeb29807723f4c2e06082336a55d31942cd2a921 100644 (file)
@@ -1,18 +1,17 @@
 <?php
 /**
- * Test Generated example of using entity_tag get API.
+ * Test Generated example demonstrating the EntityTag.get API.
  *
  * @return array
  *   API result array
  */
 function entity_tag_get_example() {
   $params = array(
-    'contact_id' => 21,
-    'tag_id' => '12',
+    'contact_id' => 3,
   );
 
   try{
-    $result = civicrm_api3('entity_tag', 'get', $params);
+    $result = civicrm_api3('EntityTag', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -39,19 +38,23 @@ function entity_tag_get_expectedresult() {
 
   $expectedResult = array(
     'is_error' => 0,
-    'not_added' => 0,
-    'added' => 1,
-    'total_count' => 1,
+    'version' => 3,
+    'count' => 1,
+    'id' => 6,
+    'values' => array(
+      '6' => array(
+        'tag_id' => '6',
+      ),
+    ),
   );
 
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testIndividualEntityTagGet
-* and can be found in
+* The test that created it is called "testIndividualEntityTagGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EntityTagTest.php
 *
 * You can see the outcome of the API tests at
index c458ff6e275dcb0350ae00e473a7eb2303ab5727..2b0363e88de9f31524284a5b618b1a531c1717f1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using event create API.
+ * Test Generated example demonstrating the Event.create API.
  *
  * @return array
  *   API result array
@@ -25,7 +25,7 @@ function event_create_example() {
   );
 
   try{
-    $result = civicrm_api3('event', 'create', $params);
+    $result = civicrm_api3('Event', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -130,11 +130,10 @@ function event_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateEventSuccess
-* and can be found in
+* The test that created it is called "testCreateEventSuccess"
+* 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
index 2bcacd927193faf29796b8425ba95320d7b960dc..e3706afb641ffbeb6d81f0f8d42d1af19a31b7d0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using event delete API.
+ * Test Generated example demonstrating the Event.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function event_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('event', 'delete', $params);
+    $result = civicrm_api3('Event', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function event_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDelete
-* and can be found in
+* The test that created it is called "testDelete"
+* 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
index a4810092830ccedd230fd47611bbde1356ebed2f..5892efb6362174b4faffd6fa0aa06ae96187c38f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using event get API.
+ * Test Generated example demonstrating the Event.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function event_get_example() {
   );
 
   try{
-    $result = civicrm_api3('event', 'get', $params);
+    $result = civicrm_api3('Event', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -75,11 +75,10 @@ function event_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetEventByEventTitle
-* and can be found in
+* The test that created it is called "testGetEventByEventTitle"
+* 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
index eb0bf411696367a671663324b274f4db2b1d9ee9..159c6c28520b9c2b276ecf5f46153c18d0923bda 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using event get API.
+ * Test Generated example demonstrating the Event.get API.
  *
  * Demonstrates use of is.Current option.
  *
@@ -13,7 +13,7 @@ function event_get_example() {
   );
 
   try{
-    $result = civicrm_api3('event', 'get', $params);
+    $result = civicrm_api3('Event', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -85,11 +85,10 @@ function event_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetIsCurrent
-* and can be found in
+* The test that created it is called "testGetIsCurrent"
+* 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
index 42b33bf7a99f4faeb6b7d6b17f57300e2b0ead00..9545de0bd8718ec562861679e6658464e95de438 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using event getsingle API.
+ * Test Generated example demonstrating the Event.getsingle API.
  *
  * Demonstrates use of return is_full .
  *
@@ -14,7 +14,7 @@ function event_getsingle_example() {
   );
 
   try{
-    $result = civicrm_api3('event', 'getsingle', $params);
+    $result = civicrm_api3('Event', 'getsingle', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,7 +61,7 @@ function event_getsingle_expectedresult() {
     'is_multiple_registrations' => 0,
     'allow_same_participant_emails' => 0,
     'is_template' => 0,
-    'created_date' => '2015-02-16 11:40:40',
+    'created_date' => '2015-02-22 23:13:11',
     'is_share' => '1',
     'is_confirm_enabled' => '1',
     'is_billing_required' => 0,
@@ -72,11 +72,10 @@ function event_getsingle_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSingleReturnIsFull
-* and can be found in
+* The test that created it is called "testGetSingleReturnIsFull"
+* 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
index 2b69bde540407c38aa94fa01eb5742c32ff470db..519c097937311b975580b051316c2525cdffcd32 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using grant create API.
+ * Test Generated example demonstrating the Grant.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function grant_create_example() {
   );
 
   try{
-    $result = civicrm_api3('grant', 'create', $params);
+    $result = civicrm_api3('Grant', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -72,11 +72,10 @@ function grant_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateGrant
-* and can be found in
+* The test that created it is called "testCreateGrant"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GrantTest.php
 *
 * You can see the outcome of the API tests at
index b2985153ea36de16e3aeb24208fe334682ff9a3c..f4323382edeb66ecd54e534b50cb721d65cb97b1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using grant delete API.
+ * Test Generated example demonstrating the Grant.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function grant_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('grant', 'delete', $params);
+    $result = civicrm_api3('Grant', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function grant_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteGrant
-* and can be found in
+* The test that created it is called "testDeleteGrant"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GrantTest.php
 *
 * You can see the outcome of the API tests at
index 2cfa59c5e367e34ee08ca6926df74a751aea2858..ca51ac066070eb624b236015fb5f9248d091cd4b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using grant get API.
+ * Test Generated example demonstrating the Grant.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function grant_get_example() {
   );
 
   try{
-    $result = civicrm_api3('grant', 'get', $params);
+    $result = civicrm_api3('Grant', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function grant_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetGrant
-* and can be found in
+* The test that created it is called "testGetGrant"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GrantTest.php
 *
 * You can see the outcome of the API tests at
index c759a438820f43c035f7832518c1296281901503..c2137ffa8a6d9ba00e356f5b9254dc4dbc26d495 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group get API.
+ * Test Generated example demonstrating the Group.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function group_get_example() {
   );
 
   try{
-    $result = civicrm_api3('group', 'get', $params);
+    $result = civicrm_api3('Group', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function group_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetGroupParamsWithGroupName
-* and can be found in
+* The test that created it is called "testGetGroupParamsWithGroupName"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupTest.php
 *
 * You can see the outcome of the API tests at
similarity index 96%
rename from api/v3/examples/Group/getfields.php
rename to api/v3/examples/Group/GetFields.php
index eb102889c34e5911819cbfd31bf44973d54e32bf..5f4962e5e361804bfbe6b4cba57bc1bd6b85169b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group getfields API.
+ * Test Generated example demonstrating the Group.getfields API.
  *
  * Demonstrate use of getfields to interrogate api.
  *
@@ -13,7 +13,7 @@ function group_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('group', 'getfields', $params);
+    $result = civicrm_api3('Group', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -183,11 +183,10 @@ function group_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testgetfields
-* and can be found in
+* The test that created it is called "testgetfields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupTest.php
 *
 * You can see the outcome of the API tests at
index 52ff8e03ae5ea36e095c7147b16f8f48a1554fd8..6c0b3ec50a2fbbd79ecb291b6374cb10fd4655fe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_contact create API.
+ * Test Generated example demonstrating the GroupContact.create API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function group_contact_create_example() {
   );
 
   try{
-    $result = civicrm_api3('group_contact', 'create', $params);
+    $result = civicrm_api3('GroupContact', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -51,11 +51,10 @@ function group_contact_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
 *
 * You can see the outcome of the API tests at
index 8fe66c2d5924017104845803940ea6d13ea7f485..cb091b88bb1b1d548838e58ba1933f399c649eab 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_contact delete API.
+ * Test Generated example demonstrating the GroupContact.delete API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function group_contact_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('group_contact', 'delete', $params);
+    $result = civicrm_api3('GroupContact', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -50,11 +50,10 @@ function group_contact_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePermanent
-* and can be found in
+* The test that created it is called "testDeletePermanent"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
 *
 * You can see the outcome of the API tests at
index 643560005bc0cee46ab2d4e70aa3e05c3a00f703..da5d396a5063b0bfb085647f1ff3baf196633a31 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_contact get API.
+ * Test Generated example demonstrating the GroupContact.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function group_contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('group_contact', 'get', $params);
+    $result = civicrm_api3('GroupContact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -57,11 +57,10 @@ function group_contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
 *
 * You can see the outcome of the API tests at
index 02d1f10d5fd253c8864523786be916cc1c20a631..304ce81c25b99d3c89164188af469b2a6af2aa89 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_contact get API.
+ * Test Generated example demonstrating the GroupContact.get API.
  *
  * Get all from group and display contacts.
  *
@@ -15,7 +15,7 @@ function group_contact_get_example() {
   );
 
   try{
-    $result = civicrm_api3('group_contact', 'get', $params);
+    $result = civicrm_api3('GroupContact', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -83,11 +83,10 @@ function group_contact_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetGroupID
-* and can be found in
+* The test that created it is called "testGetGroupID"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
 *
 * You can see the outcome of the API tests at
index a4e3c8fc5c0c667baf08ae09e907692c40652113..cec9d0c5072cdfd34f1ee5790bcff853d1240686 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_nesting create API.
+ * Test Generated example demonstrating the GroupNesting.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function group_nesting_create_example() {
   );
 
   try{
-    $result = civicrm_api3('group_nesting', 'create', $params);
+    $result = civicrm_api3('GroupNesting', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -50,11 +50,10 @@ function group_nesting_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupNestingTest.php
 *
 * You can see the outcome of the API tests at
index 332e7bd4cfab23c132031174af44f970c1f53802..6868d07231f1abcb434e24c34d724bed9b1cd88e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_nesting delete API.
+ * Test Generated example demonstrating the GroupNesting.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function group_nesting_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('group_nesting', 'delete', $params);
+    $result = civicrm_api3('GroupNesting', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function group_nesting_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDelete
-* and can be found in
+* The test that created it is called "testDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupNestingTest.php
 *
 * You can see the outcome of the API tests at
index 140e892b3e48354d3617cb5ba50a9a35cff27cf1..cfb8d6dc3e0bcd2408181ff6b867990e8aec5ca3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_nesting get API.
+ * Test Generated example demonstrating the GroupNesting.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function group_nesting_get_example() {
   );
 
   try{
-    $result = civicrm_api3('group_nesting', 'get', $params);
+    $result = civicrm_api3('GroupNesting', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -54,11 +54,10 @@ function group_nesting_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupNestingTest.php
 *
 * You can see the outcome of the API tests at
index 18253e5a12bb2eab85f5caa6ebf13945302a025a..445603ea39be6e9ca2ede3e04ecf6e64dc0ea038 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_organization create API.
+ * Test Generated example demonstrating the GroupOrganization.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function group_organization_create_example() {
   );
 
   try{
-    $result = civicrm_api3('group_organization', 'create', $params);
+    $result = civicrm_api3('GroupOrganization', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -52,11 +52,10 @@ function group_organization_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGroupOrganizationCreate
-* and can be found in
+* The test that created it is called "testGroupOrganizationCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupOrganizationTest.php
 *
 * You can see the outcome of the API tests at
index 7dbc6fcc0f636139332fca9fc5e0088984c19dd2..295faa72d781b4e0a605d1f58dcb0a7ba8f43a6c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_organization delete API.
+ * Test Generated example demonstrating the GroupOrganization.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function group_organization_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('group_organization', 'delete', $params);
+    $result = civicrm_api3('GroupOrganization', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function group_organization_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGroupOrganizationDelete
-* and can be found in
+* The test that created it is called "testGroupOrganizationDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupOrganizationTest.php
 *
 * You can see the outcome of the API tests at
index c2113708703c26a4a571604d536ff5875e020fb6..94a1edb33032f57fbb39e841fc42e7d468333b40 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_organization get API.
+ * Test Generated example demonstrating the GroupOrganization.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function group_organization_get_example() {
   );
 
   try{
-    $result = civicrm_api3('group_organization', 'get', $params);
+    $result = civicrm_api3('GroupOrganization', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function group_organization_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGroupOrganizationGet
-* and can be found in
+* The test that created it is called "testGroupOrganizationGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupOrganizationTest.php
 *
 * You can see the outcome of the API tests at
index 996f6d6bed94fa08774409931ea5116d1e91bfcc..e37267c400791bb7f39e870b408d2afb92a76aff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using im create API.
+ * Test Generated example demonstrating the Im.create API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function im_create_example() {
   );
 
   try{
-    $result = civicrm_api3('im', 'create', $params);
+    $result = civicrm_api3('Im', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -60,11 +60,10 @@ function im_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateIm
-* and can be found in
+* The test that created it is called "testCreateIm"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
 *
 * You can see the outcome of the API tests at
index 489ec018e243d597ad619e1792a66604fbc14db6..cbf48c075d58676255065c3fb9e27e9f02794d75 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using im delete API.
+ * Test Generated example demonstrating the Im.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function im_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('im', 'delete', $params);
+    $result = civicrm_api3('Im', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function im_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteIm
-* and can be found in
+* The test that created it is called "testDeleteIm"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
 *
 * You can see the outcome of the API tests at
index c81f7c22594e3407d5270ca078f3b2957093d35b..1d1afb45ec5b6bc6226f9a7ec976069b3675d06f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using im get API.
+ * Test Generated example demonstrating the Im.get API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function im_get_example() {
   );
 
   try{
-    $result = civicrm_api3('im', 'get', $params);
+    $result = civicrm_api3('Im', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -60,11 +60,10 @@ function im_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetIm
-* and can be found in
+* The test that created it is called "testGetIm"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ImTest.php
 *
 * You can see the outcome of the API tests at
index ff90bd441f5fa9cce790f0a18500a5d91b48155a..12a35425ac76bf7140e4d890670bd486fb8e6a3c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using job create API.
+ * Test Generated example demonstrating the Job.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function job_create_example() {
   );
 
   try{
-    $result = civicrm_api3('job', 'create', $params);
+    $result = civicrm_api3('Job', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -67,11 +67,10 @@ function job_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/JobTest.php
 *
 * You can see the outcome of the API tests at
index 707a6c26341c223c42426537aff9d4eed1141657..c7aefcbdff3c2f9bdb1b5911739721862249d89d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using job delete API.
+ * Test Generated example demonstrating the Job.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function job_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('job', 'delete', $params);
+    $result = civicrm_api3('Job', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -41,11 +41,10 @@ function job_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDelete
-* and can be found in
+* The test that created it is called "testDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/JobTest.php
 *
 * You can see the outcome of the API tests at
index 497c58e3e7b608433c3141e9a89c6d58d01425f2..42085b693cbb7c54fc2981e32f62ebe442445041 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using line_item create API.
+ * Test Generated example demonstrating the LineItem.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function line_item_create_example() {
   );
 
   try{
-    $result = civicrm_api3('line_item', 'create', $params);
+    $result = civicrm_api3('LineItem', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -71,11 +71,10 @@ function line_item_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateLineItem
-* and can be found in
+* The test that created it is called "testCreateLineItem"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LineItemTest.php
 *
 * You can see the outcome of the API tests at
index c66221f2d82f6eb62283cc5ec171f0f8a5e4c353..62b9de0384c7b17bf0fda93edecd4645d7b8a9a6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using line_item delete API.
+ * Test Generated example demonstrating the LineItem.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function line_item_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('line_item', 'delete', $params);
+    $result = civicrm_api3('LineItem', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function line_item_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteLineItem
-* and can be found in
+* The test that created it is called "testDeleteLineItem"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LineItemTest.php
 *
 * You can see the outcome of the API tests at
index 349c37b3b2a211ad550598a1aef9a19f5a947399..4972579c3d4006a288247f77e788d61df9bfe3ec 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using line_item get API.
+ * Test Generated example demonstrating the LineItem.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function line_item_get_example() {
   );
 
   try{
-    $result = civicrm_api3('line_item', 'get', $params);
+    $result = civicrm_api3('LineItem', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -62,11 +62,10 @@ function line_item_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetBasicLineItem
-* and can be found in
+* The test that created it is called "testGetBasicLineItem"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LineItemTest.php
 *
 * You can see the outcome of the API tests at
similarity index 89%
rename from api/v3/examples/LocBlock/simpleCreate.php
rename to api/v3/examples/LocBlock/Create.php
index 0a21eecbe7d35f556516fe2c8efe7a81f427dfc1..7c1410f0ec5b924321c98dbbd52978d0e2a522aa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using loc_block create API.
+ * Test Generated example demonstrating the LocBlock.create API.
  *
  * Create locBlock with existing entities
  *
@@ -15,7 +15,7 @@ function loc_block_create_example() {
   );
 
   try{
-    $result = civicrm_api3('loc_block', 'create', $params);
+    $result = civicrm_api3('LocBlock', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -63,11 +63,10 @@ function loc_block_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateLocBlock
-* and can be found in
+* The test that created it is called "testCreateLocBlock"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
 *
 * You can see the outcome of the API tests at
similarity index 94%
rename from api/v3/examples/LocBlock/createEntities.php
rename to api/v3/examples/LocBlock/CreateEntities.php
index 92e4755773cea49f6a0d21db8a6df5efc1e09c3f..f6f33f935585031fdc552046a598d65aa1f185bc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using loc_block create API.
+ * Test Generated example demonstrating the LocBlock.create API.
  *
  * Create entities and locBlock in 1 api call.
  *
@@ -28,7 +28,7 @@ function loc_block_create_example() {
   );
 
   try{
-    $result = civicrm_api3('loc_block', 'create', $params);
+    $result = civicrm_api3('LocBlock', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -122,11 +122,10 @@ function loc_block_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateLocBlockEntities
-* and can be found in
+* The test that created it is called "testCreateLocBlockEntities"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
 *
 * You can see the outcome of the API tests at
similarity index 92%
rename from api/v3/examples/LocBlock/getEntities.php
rename to api/v3/examples/LocBlock/Get.php
index a715e07e52b90109fd8a057b914da634af1150e9..d0f3868a0a7f5f744158566fe1574373dd51fee1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using loc_block get API.
+ * Test Generated example demonstrating the LocBlock.get API.
  *
  * Get entities and location block in 1 api call
  *
@@ -14,7 +14,7 @@ function loc_block_get_example() {
   );
 
   try{
-    $result = civicrm_api3('loc_block', 'get', $params);
+    $result = civicrm_api3('LocBlock', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -91,11 +91,10 @@ function loc_block_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateLocBlockEntities
-* and can be found in
+* The test that created it is called "testCreateLocBlockEntities"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
 *
 * You can see the outcome of the API tests at
index de33dee3831f983a76dba798c36abf94c6c8d692..2c1e69bbab5491243ba035ad2e32dfc9b6d47313 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mail_settings get API.
+ * Test Generated example demonstrating the MailSettings.get API.
  *
  * Demonstrates get + delete in the same call.
  *
@@ -14,7 +14,7 @@ function mail_settings_get_example() {
   );
 
   try{
-    $result = civicrm_api3('mail_settings', 'get', $params);
+    $result = civicrm_api3('MailSettings', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -80,11 +80,10 @@ function mail_settings_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetMailSettingsChainDelete
-* and can be found in
+* The test that created it is called "testGetMailSettingsChainDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
 *
 * You can see the outcome of the API tests at
index 11b08b8e41f91d60621dd4edb1b1a449c63727d9..f271945d8ca05253a975eeb8ed6a71f9f98bed97 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mail_settings create API.
+ * Test Generated example demonstrating the MailSettings.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function mail_settings_create_example() {
   );
 
   try{
-    $result = civicrm_api3('mail_settings', 'create', $params);
+    $result = civicrm_api3('MailSettings', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,10 +47,10 @@ function mail_settings_create_expectedresult() {
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 2,
+    'id' => 5,
     'values' => array(
-      '2' => array(
-        'id' => '2',
+      '5' => array(
+        'id' => '5',
         'domain_id' => '1',
         'name' => 'my mail setting',
         'is_default' => '1',
@@ -71,11 +71,10 @@ function mail_settings_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateMailSettings
-* and can be found in
+* The test that created it is called "testDeleteMailSettings"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
 *
 * You can see the outcome of the API tests at
index 7dbfae3d3ab4764a59b601b123bdf3d42ff48fc2..14cf3ba324e46e3406bb7bbe21c342d011e5ef1c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mail_settings delete API.
+ * Test Generated example demonstrating the MailSettings.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function mail_settings_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('mail_settings', 'delete', $params);
+    $result = civicrm_api3('MailSettings', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function mail_settings_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteMailSettings
-* and can be found in
+* The test that created it is called "testDeleteMailSettings"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
 *
 * You can see the outcome of the API tests at
index c91ed9f9825da75cc106b51ce495afb66a037f9e..025ba20a82f452bda729b1eecff906beeb3ec885 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mail_settings get API.
+ * Test Generated example demonstrating the MailSettings.get API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function mail_settings_get_example() {
   );
 
   try{
-    $result = civicrm_api3('mail_settings', 'get', $params);
+    $result = civicrm_api3('MailSettings', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -66,11 +66,10 @@ function mail_settings_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetMailSettings
-* and can be found in
+* The test that created it is called "testGetMailSettings"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailSettingsTest.php
 *
 * You can see the outcome of the API tests at
diff --git a/api/v3/examples/MailSettings/GetOptions.php b/api/v3/examples/MailSettings/GetOptions.php
new file mode 100644 (file)
index 0000000..d63fe02
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Test Generated example demonstrating the MailSettings.getoptions API.
+ *
+ * @return array
+ *   API result array
+ */
+function mail_settings_getoptions_example() {
+  $params = array(
+    'field' => 'protocol',
+  );
+
+  try{
+    $result = civicrm_api3('MailSettings', 'getoptions', $params);
+  }
+  catch (CiviCRM_API3_Exception $e) {
+    // Handle error here.
+    $errorMessage = $e->getMessage();
+    $errorCode = $e->getErrorCode();
+    $errorData = $e->getExtraParams();
+    return array(
+      'error' => $errorMessage,
+      'error_code' => $errorCode,
+      'error_data' => $errorData,
+    );
+  }
+
+  return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ *   API result array
+ */
+function mail_settings_getoptions_expectedresult() {
+
+  $expectedResult = array(
+    'is_error' => 0,
+    'version' => 3,
+    'count' => 4,
+    'values' => array(
+      '1' => 'IMAP',
+      '2' => 'Maildir',
+      '3' => 'POP3',
+      '4' => 'Localdir',
+    ),
+  );
+
+  return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testmailProtocol"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ConstantTest.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
+*/
index 98feb8fd417196f44e18a7c1b2a301be94394df7..5772aa62015844c965c39361592c94e462f40441 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mailing create API.
+ * Test Generated example demonstrating the Mailing.create API.
  *
  * @return array
  *   API result array
@@ -12,14 +12,38 @@ function mailing_create_example() {
 {domain.address}{action.optOutUrl}',
     'body_html' => '<p>This is {contact.display_name}.</p><p>{domain.address}{action.optOutUrl}</p>',
     'name' => 'mailing name',
-    'created_id' => 3,
+    'created_id' => 9,
     'header_id' => '',
     'footer_id' => '',
-    'scheduled_date' => 'now',
+    'groups' => array(
+      'include' => array(
+        '0' => 7,
+      ),
+      'exclude' => array(
+        '0' => 8,
+      ),
+    ),
+    'mailings' => array(
+      'include' => array(),
+      'exclude' => array(),
+    ),
+    'options' => array(
+      'force_rollback' => 1,
+    ),
+    'api.mailing_job.create' => 1,
+    'api.MailingRecipients.get' => array(
+      'mailing_id' => '$value.id',
+      'api.contact.getvalue' => array(
+        'return' => 'display_name',
+      ),
+      'api.email.getvalue' => array(
+        'return' => 'email',
+      ),
+    ),
   );
 
   try{
-    $result = civicrm_api3('mailing', 'create', $params);
+    $result = civicrm_api3('Mailing', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -48,10 +72,10 @@ function mailing_create_expectedresult() {
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 1,
+    'id' => 4,
     'values' => array(
-      '1' => array(
-        'id' => '1',
+      '4' => array(
+        'id' => '4',
         'domain_id' => '1',
         'header_id' => '',
         'footer_id' => '',
@@ -74,10 +98,10 @@ function mailing_create_expectedresult() {
         'is_completed' => '',
         'msg_template_id' => '',
         'override_verp' => '1',
-        'created_id' => '3',
+        'created_id' => '9',
         'created_date' => '2013-07-28 08:49:19',
         'scheduled_id' => '',
-        'scheduled_date' => '20130728085413',
+        'scheduled_date' => '',
         'approver_id' => '',
         'approval_date' => '',
         'approval_status_id' => '',
@@ -90,6 +114,43 @@ function mailing_create_expectedresult() {
         'hash' => '',
         'location_type_id' => '',
         'email_selection_method' => '',
+        'api.mailing_job.create' => array(
+          'is_error' => 0,
+          'version' => 3,
+          'count' => 1,
+          'id' => 5,
+          'values' => array(
+            '0' => array(
+              'id' => '5',
+              'mailing_id' => '4',
+              'scheduled_date' => '20130728085413',
+              'start_date' => '',
+              'end_date' => '',
+              'status' => 'Scheduled',
+              'is_test' => 0,
+              'job_type' => '',
+              'parent_id' => '',
+              'job_offset' => '',
+              'job_limit' => '',
+            ),
+          ),
+        ),
+        'api.MailingRecipients.get' => array(
+          'is_error' => 0,
+          'version' => 3,
+          'count' => 1,
+          'id' => 4,
+          'values' => array(
+            '0' => array(
+              'id' => '4',
+              'mailing_id' => '4',
+              'contact_id' => '10',
+              'email_id' => '10',
+              'api.contact.getvalue' => 'Mr. Includer Person II',
+              'api.email.getvalue' => 'include.me@example.org',
+            ),
+          ),
+        ),
       ),
     ),
   );
@@ -97,11 +158,10 @@ function mailing_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testMailerCreateSuccess
-* and can be found in
+* The test that created it is called "testMailerPreviewRecipients"
+* 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
index f7caaba88df6e78133ba890ba67f53951ceb3521..4f60cc881c00ce7bfe4694ac78fd6cf89dc9df02 100644 (file)
@@ -1,17 +1,17 @@
 <?php
 /**
- * Test Generated example of using mailing delete API.
+ * Test Generated example demonstrating the Mailing.delete API.
  *
  * @return array
  *   API result array
  */
 function mailing_delete_example() {
   $params = array(
-    'id' => 16,
+    'id' => 18,
   );
 
   try{
-    $result = civicrm_api3('mailing', 'delete', $params);
+    $result = civicrm_api3('Mailing', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function mailing_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testMailerDeleteSuccess
-* and can be found in
+* The test that created it is called "testMailerDeleteSuccess"
+* 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
index 4f6b8b5f22f5ded8837f294d6b11e9a2e761bbdf..fbf518322be9383b8692c2943a14662cd53d419f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mailing submit API.
+ * Test Generated example demonstrating the Mailing.submit API.
  *
  * @return array
  *   API result array
@@ -8,11 +8,12 @@
 function mailing_submit_example() {
   $params = array(
     'scheduled_date' => '2014-12-13 10:00:00',
-    'id' => 9,
+    'approval_date' => '2014-12-13 00:00:00',
+    'id' => 16,
   );
 
   try{
-    $result = civicrm_api3('mailing', 'submit', $params);
+    $result = civicrm_api3('Mailing', 'submit', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -41,13 +42,13 @@ function mailing_submit_expectedresult() {
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 9,
+    'id' => 16,
     'values' => array(
-      '9' => array(
-        'id' => '9',
+      '16' => array(
+        'id' => '16',
         'domain_id' => '1',
         'header_id' => '',
-        'footer_id' => '',
+        'footer_id' => '24',
         'reply_id' => '8',
         'unsubscribe_id' => '5',
         'resubscribe_id' => '6',
@@ -59,7 +60,7 @@ function mailing_submit_expectedresult() {
         'subject' => 'Hello {contact.display_name}',
         'body_text' => 'This is {contact.display_name}.
 {domain.address}{action.optOutUrl}',
-        'body_html' => '<p>This is {contact.display_name}.</p><p>{domain.address}{action.optOutUrl}</p>',
+        'body_html' => '<p>Look ma, magic tokens in the markup!</p>',
         'url_tracking' => '1',
         'forward_replies' => 0,
         'auto_responder' => 0,
@@ -67,13 +68,13 @@ function mailing_submit_expectedresult() {
         'is_completed' => '',
         'msg_template_id' => '',
         'override_verp' => '1',
-        'created_id' => '22',
+        'created_id' => '35',
         'created_date' => '2013-07-28 08:49:19',
-        'scheduled_id' => '22',
+        'scheduled_id' => '36',
         'scheduled_date' => '20130728085413',
-        'approver_id' => '',
-        'approval_date' => '',
-        'approval_status_id' => '',
+        'approver_id' => '36',
+        'approval_date' => '20130728085413',
+        'approval_status_id' => '1',
         'approval_note' => '',
         'is_archived' => 0,
         'visibility' => 'Public Pages',
@@ -90,11 +91,10 @@ function mailing_submit_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testMailerSubmit
-* and can be found in
+* The test that created it is called "testMailerSubmit"
+* 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
index a211808822cd6d9a7e2477444ec479b965475cf2..674ea54bf9db95ac18893a94a95c8d4c745165fa 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using mailing_a_b create API.
+ * Test Generated example demonstrating the MailingAB.create API.
  *
  * @return array
  *   API result array
@@ -10,14 +10,14 @@ function mailing_a_b_create_example() {
     'mailing_id_a' => 1,
     'mailing_id_b' => 2,
     'mailing_id_c' => 3,
-    'testing_criteria_id' => 1,
-    'winner_criteria_id' => 1,
+    'testing_criteria' => 'subject',
+    'winner_criteria' => 'open',
     'declare_winning_time' => '+2 days',
     'group_percentage' => 10,
   );
 
   try{
-    $result = civicrm_api3('mailing_a_b', 'create', $params);
+    $result = civicrm_api3('MailingAB', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -56,10 +56,10 @@ function mailing_a_b_create_expectedresult() {
         'mailing_id_b' => '2',
         'mailing_id_c' => '3',
         'domain_id' => '1',
-        'testing_criteria_id' => '1',
-        'winner_criteria_id' => '1',
+        'testing_criteria_id' => '',
+        'winner_criteria_id' => '',
         'specific_url' => '',
-        'declare_winning_time' => '20150218114218',
+        'declare_winning_time' => '20150224231452',
         'group_percentage' => '10',
       ),
     ),
@@ -68,11 +68,10 @@ function mailing_a_b_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testMailingABCreateSuccess
-* and can be found in
+* The test that created it is called "testMailingABCreateSuccess"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingABTest.php
 *
 * You can see the outcome of the API tests at
index b6ac9d780449081112dd0dbb230bcd54c2f9b792..0821f6b1dbe35ab301c11ee7844664e7dffeb704 100644 (file)
@@ -1,25 +1,24 @@
 <?php
 /**
- * Test Generated example of using membership create API.
+ * Test Generated example demonstrating the Membership.create API.
  *
  * @return array
  *   API result array
  */
 function membership_create_example() {
   $params = array(
-    'contact_id' => 88,
-    'membership_type_id' => 53,
-    'join_date' => '2009-01-21',
-    'start_date' => '2009-01-21',
-    'end_date' => '2009-12-21',
+    'contact_id' => 76,
+    'membership_type_id' => 45,
+    'join_date' => '2006-01-21',
+    'start_date' => '2006-01-21',
+    'end_date' => '2006-12-21',
     'source' => 'Payment',
     'is_override' => 1,
-    'status_id' => 33,
-    'custom_1' => 'custom string',
+    'status_id' => 29,
   );
 
   try{
-    $result = civicrm_api3('membership', 'create', $params);
+    $result = civicrm_api3('Membership', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -52,13 +51,13 @@ function membership_create_expectedresult() {
     'values' => array(
       '1' => array(
         'id' => '1',
-        'contact_id' => '88',
-        'membership_type_id' => '53',
-        'join_date' => '20090121000000',
+        'contact_id' => '76',
+        'membership_type_id' => '45',
+        'join_date' => '20060121000000',
         'start_date' => '2013-07-29 00:00:00',
         'end_date' => '2013-08-04 00:00:00',
         'source' => 'Payment',
-        'status_id' => '33',
+        'status_id' => '29',
         'is_override' => '1',
         'owner_membership_id' => '',
         'max_related' => '',
@@ -73,11 +72,10 @@ function membership_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateWithCustom
-* and can be found in
+* The test that created it is called "testMembershipCreate"
+* 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
diff --git a/api/v3/examples/Membership/CreateWithCustomData.php b/api/v3/examples/Membership/CreateWithCustomData.php
new file mode 100644 (file)
index 0000000..79ecdb7
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Test Generated example demonstrating the Membership.create API.
+ *
+ * @return array
+ *   API result array
+ */
+function membership_create_example() {
+  $params = array(
+    'contact_id' => 88,
+    'membership_type_id' => 53,
+    'join_date' => '2009-01-21',
+    'start_date' => '2009-01-21',
+    'end_date' => '2009-12-21',
+    'source' => 'Payment',
+    'is_override' => 1,
+    'status_id' => 33,
+    'custom_1' => 'custom string',
+  );
+
+  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(
+      'error' => $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' => '88',
+        'membership_type_id' => '53',
+        'join_date' => '20090121000000',
+        'start_date' => '2013-07-29 00:00:00',
+        'end_date' => '2013-08-04 00:00:00',
+        'source' => 'Payment',
+        'status_id' => '33',
+        '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 "testCreateWithCustom"
+* 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
+*/
index 29ef67b90bb5583f59921e9c8616f4c5abeb7de1..8ed8df71ce9252d0f18d483f8ba6f77aa67e8bd3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership delete API.
+ * Test Generated example demonstrating the Membership.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function membership_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('membership', 'delete', $params);
+    $result = civicrm_api3('Membership', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function membership_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testMembershipDelete
-* and can be found in
+* The test that created it is called "testMembershipDelete"
+* 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
similarity index 90%
rename from api/v3/examples/Membership/filterIsCurrent.php
rename to api/v3/examples/Membership/FilterIsCurrent.php
index 506dd3365d856bb51fe77fc190a3a22035156af6..23d4ff64260fc59b58d9bda1b38b8903b8690600 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership get API.
+ * Test Generated example demonstrating the Membership.get API.
  *
  * Demonstrates use of 'filter' active_only' param.
  *
@@ -16,7 +16,7 @@ function membership_get_example() {
   );
 
   try{
-    $result = civicrm_api3('membership', 'get', $params);
+    $result = civicrm_api3('Membership', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -68,11 +68,10 @@ function membership_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetOnlyActive
-* and can be found in
+* The test that created it is called "testGetOnlyActive"
+* 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
index abde2a591ce1c7ebdc244e204934a05b96c89760..e09a1a50e024d9211f661790dd3d49ed1d7be6d9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership get API.
+ * Test Generated example demonstrating the Membership.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function membership_get_example() {
   );
 
   try{
-    $result = civicrm_api3('membership', 'get', $params);
+    $result = civicrm_api3('Membership', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function membership_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetWithParamsMemberShipIdAndCustom
-* and can be found in
+* The test that created it is called "testGetWithParamsMemberShipIdAndCustom"
+* 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
similarity index 87%
rename from api/v3/examples/Membership/Update.php
rename to api/v3/examples/Membership/UpdateCustomData.php
index c50a2ead276226771dd019e9895337fb50434b6b..49e3b4b5cac75f574ff26415d862cfe0e03dadb9 100644 (file)
@@ -1,11 +1,11 @@
 <?php
 /**
- * Test Generated example of using membership update API.
+ * Test Generated example demonstrating the Membership.create API.
  *
  * @return array
  *   API result array
  */
-function membership_update_example() {
+function membership_create_example() {
   $params = array(
     'contact_id' => 106,
     'membership_type_id' => 65,
@@ -19,7 +19,7 @@ function membership_update_example() {
   );
 
   try{
-    $result = civicrm_api3('membership', 'update', $params);
+    $result = civicrm_api3('Membership', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -42,7 +42,7 @@ function membership_update_example() {
  * @return array
  *   API result array
  */
-function membership_update_expectedresult() {
+function membership_create_expectedresult() {
 
   $expectedResult = array(
     'is_error' => 0,
@@ -73,11 +73,10 @@ function membership_update_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testUpdateWithCustom
-* and can be found in
+* The test that created it is called "testUpdateWithCustom"
+* 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
index 149fc257de306555a1afe21a5e79ffe0928ef4e6..3550d327ebaf70a9ec5e82e0890a23d42e280d38 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_payment create API.
+ * Test Generated example demonstrating the MembershipPayment.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function membership_payment_create_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_payment', 'create', $params);
+    $result = civicrm_api3('MembershipPayment', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -54,11 +54,10 @@ function membership_payment_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipPaymentTest.php
 *
 * You can see the outcome of the API tests at
index 4f7bfe3a0b402993c13d24197cd4663d3d442c23..b42b1d07eb228306d701628908bf4dc49e8879a7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_payment get API.
+ * Test Generated example demonstrating the MembershipPayment.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function membership_payment_get_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_payment', 'get', $params);
+    $result = civicrm_api3('MembershipPayment', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -54,11 +54,10 @@ function membership_payment_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipPaymentTest.php
 *
 * You can see the outcome of the API tests at
index d57ae4c7d63428a7b5cd436cdac8feabf331f8b3..56b0ed00590c6ba4e99832214c67471650618290 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_status create API.
+ * Test Generated example demonstrating the MembershipStatus.create API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function membership_status_create_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_status', 'create', $params);
+    $result = civicrm_api3('MembershipStatus', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function membership_status_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipStatusTest.php
 *
 * You can see the outcome of the API tests at
index 255ab6afa569890dab5c2c16c1d8855f4c28426b..f3b8b20430e16528b750c22d3905becc77d248ff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_status get API.
+ * Test Generated example demonstrating the MembershipStatus.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function membership_status_get_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_status', 'get', $params);
+    $result = civicrm_api3('MembershipStatus', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -60,11 +60,10 @@ function membership_status_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipStatusTest.php
 *
 * You can see the outcome of the API tests at
index 2b7ac831c61165267a214c215da072e667075928..ad4dd238e069999f823b72b8cf1c5769dd859e63 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_type create API.
+ * Test Generated example demonstrating the MembershipType.create API.
  *
  * @return array
  *   API result array
@@ -20,7 +20,7 @@ function membership_type_create_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_type', 'create', $params);
+    $result = civicrm_api3('MembershipType', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -81,11 +81,10 @@ function membership_type_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTypeTest.php
 *
 * You can see the outcome of the API tests at
index c30d8b32830276a03fe201869a47ebdd4cc99102..6a12a8a1e2330d72dd3d4b9c223a401001f70cdc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_type delete API.
+ * Test Generated example demonstrating the MembershipType.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function membership_type_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_type', 'delete', $params);
+    $result = civicrm_api3('MembershipType', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function membership_type_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDelete
-* and can be found in
+* The test that created it is called "testDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTypeTest.php
 *
 * You can see the outcome of the API tests at
index 15078ea995d34c95e8b7eb0a758ac5ba374a127a..e3d8fa2a57939393c76276a7982426b6e3cd4ae3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using membership_type get API.
+ * Test Generated example demonstrating the MembershipType.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function membership_type_get_example() {
   );
 
   try{
-    $result = civicrm_api3('membership_type', 'get', $params);
+    $result = civicrm_api3('MembershipType', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -62,11 +62,10 @@ function membership_type_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MembershipTypeTest.php
 *
 * You can see the outcome of the API tests at
index 0cea8626732cd976d471d60502d528cabda14d72..af72d924c6d88d30a1172a958f96d3d117e17109 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using message_template create API.
+ * Test Generated example demonstrating the MessageTemplate.create API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function message_template_create_example() {
   );
 
   try{
-    $result = civicrm_api3('message_template', 'create', $params);
+    $result = civicrm_api3('MessageTemplate', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -67,11 +67,10 @@ function message_template_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
 *
 * You can see the outcome of the API tests at
index ed5353a097535b17f26799f0443a72fc80575da4..c18d9b93f05ed58e7fb8e61ca2059b54dfe747d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using message_template delete API.
+ * Test Generated example demonstrating the MessageTemplate.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function message_template_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('message_template', 'delete', $params);
+    $result = civicrm_api3('MessageTemplate', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function message_template_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDelete
-* and can be found in
+* The test that created it is called "testDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
 *
 * You can see the outcome of the API tests at
index 300eb9c38376298190338e2d49b8442e92efd306..af55e83b253e33992d69f1e9bd429ad6e8452996 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using message_template get API.
+ * Test Generated example demonstrating the MessageTemplate.get API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function message_template_get_example() {
   );
 
   try{
-    $result = civicrm_api3('message_template', 'get', $params);
+    $result = civicrm_api3('MessageTemplate', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -67,11 +67,10 @@ function message_template_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
 *
 * You can see the outcome of the API tests at
index 6e51ea80f29fe86fd720efdadbf00693453dff6b..55c838ba45e202ec6f06a0db047811f767249ee9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using note create API.
+ * Test Generated example demonstrating the Note.create API.
  *
  * @return array
  *   API result array
@@ -16,7 +16,7 @@ function note_create_example() {
   );
 
   try{
-    $result = civicrm_api3('note', 'create', $params);
+    $result = civicrm_api3('Note', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -63,11 +63,10 @@ function note_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/NoteTest.php
 *
 * You can see the outcome of the API tests at
index 6fc6497699696344a37c36838c95dd5979f40278..7f1e6c76577786e893e77ef077d23e7a02b4aa6f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using note delete API.
+ * Test Generated example demonstrating the Note.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function note_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('note', 'delete', $params);
+    $result = civicrm_api3('Note', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function note_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDelete
-* and can be found in
+* The test that created it is called "testDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/NoteTest.php
 *
 * You can see the outcome of the API tests at
index 04d4ecd41f22e08c0c78616de13e1ecaf7ef6870..a794862afadb1cc860eef308349d34b70347d1fe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using note get API.
+ * Test Generated example demonstrating the Note.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function note_get_example() {
   );
 
   try{
-    $result = civicrm_api3('note', 'get', $params);
+    $result = civicrm_api3('Note', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,11 +47,10 @@ function note_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/NoteTest.php
 *
 * You can see the outcome of the API tests at
index 20e0ace16261de850646a832957e0326e63f3c3c..d6749ef81e58fefac00e6703ba8a9aada732441d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using option_group create API.
+ * Test Generated example demonstrating the OptionGroup.create API.
  *
  * @return array
  *   API result array
@@ -21,7 +21,7 @@ function option_group_create_example() {
   );
 
   try{
-    $result = civicrm_api3('option_group', 'create', $params);
+    $result = civicrm_api3('OptionGroup', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -68,11 +68,10 @@ function option_group_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetOptionCreateSuccess
-* and can be found in
+* The test that created it is called "testGetOptionCreateSuccess"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionGroupTest.php
 *
 * You can see the outcome of the API tests at
index 3d86b04aab348f741e0a063834740039d0190569..4c8490e38c9953651ffebc8f9c1b997057aabcdc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using option_group delete API.
+ * Test Generated example demonstrating the OptionGroup.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function option_group_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('option_group', 'delete', $params);
+    $result = civicrm_api3('OptionGroup', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function option_group_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteOptionGroup
-* and can be found in
+* The test that created it is called "testDeleteOptionGroup"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionGroupTest.php
 *
 * You can see the outcome of the API tests at
index 26f5aadfd6c17d9f39c10fad6d96144bc4d10542..8351caf8501b3734036d7c9af74b11863baae5bb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using option_group get API.
+ * Test Generated example demonstrating the OptionGroup.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function option_group_get_example() {
   );
 
   try{
-    $result = civicrm_api3('option_group', 'get', $params);
+    $result = civicrm_api3('OptionGroup', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -56,11 +56,10 @@ function option_group_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetOptionGroupByName
-* and can be found in
+* The test that created it is called "testGetOptionGroupByName"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionGroupTest.php
 *
 * You can see the outcome of the API tests at
index e7f0b431046d6b271f2900e575f70ca53be9f5bd..7a291319f1ae802b6ba8bbcb0d20e59ce4c01f58 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using option_value get API.
+ * Test Generated example demonstrating the OptionValue.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function option_value_get_example() {
   );
 
   try{
-    $result = civicrm_api3('option_value', 'get', $params);
+    $result = civicrm_api3('OptionValue', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -102,11 +102,10 @@ function option_value_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetOptionGroup
-* and can be found in
+* The test that created it is called "testGetOptionGroup"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionValueTest.php
 *
 * You can see the outcome of the API tests at
index 9af05eb48d4a1e737c813c298bc60d9050f75ad3..b0ed2bdaf49bbfb30f1e8ca6e14788f58397bb1e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using option_value getsingle API.
+ * Test Generated example demonstrating the OptionValue.getsingle API.
  *
  * Demonstrates use of Sort param (available in many api functions). Also, getsingle.
  *
@@ -17,7 +17,7 @@ function option_value_getsingle_example() {
   );
 
   try{
-    $result = civicrm_api3('option_value', 'getsingle', $params);
+    $result = civicrm_api3('OptionValue', 'getsingle', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -57,11 +57,10 @@ function option_value_getsingle_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSingleValueOptionValueSort
-* and can be found in
+* The test that created it is called "testGetSingleValueOptionValueSort"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionValueTest.php
 *
 * You can see the outcome of the API tests at
index ec0758c01f9038bbb5dd755b7bb699561464f465..54bf5c55b2252fa4bcc2770e0808f5cfc9c4c736 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant create API.
+ * Test Generated example demonstrating the Participant.create API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function participant_create_example() {
   );
 
   try{
-    $result = civicrm_api3('participant', 'create', $params);
+    $result = civicrm_api3('Participant', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -74,11 +74,10 @@ function participant_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateWithCustom
-* and can be found in
+* The test that created it is called "testCreateWithCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
 *
 * You can see the outcome of the API tests at
index f43eacece9526b6e62ab9bf5f0945b70cbe13505..5c1fb35e05b0ef1ea373ac29651d2408bcec70de 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant get API.
+ * Test Generated example demonstrating the Participant.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function participant_get_example() {
   );
 
   try{
-    $result = civicrm_api3('participant', 'get', $params);
+    $result = civicrm_api3('Participant', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -77,11 +77,10 @@ function participant_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetParamsAsIdOnly
-* and can be found in
+* The test that created it is called "testGetParamsAsIdOnly"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
 *
 * You can see the outcome of the API tests at
index 2e95fc755988e3575f6b329bad20fe590ae0c67e..48277c28b441db8ac9622a3da3163a32cc083c1a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant Get API.
+ * Test Generated example demonstrating the Participant.get API.
  *
  * Criteria delete by nesting a GET & a DELETE.
  *
@@ -14,7 +14,7 @@ function participant_get_example() {
   );
 
   try{
-    $result = civicrm_api3('participant', 'Get', $params);
+    $result = civicrm_api3('Participant', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -120,11 +120,10 @@ function participant_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testNestedDelete
-* and can be found in
+* The test that created it is called "testNestedDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
 *
 * You can see the outcome of the API tests at
index 4998e2570b5f651994ee361dfd2cd8439ddb5187..8d989c25334abedb39b858a6a0a9290b8d2c05a2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant get API.
+ * Test Generated example demonstrating the Participant.get API.
  *
  * Demonstrates use of nested get to fetch event data with participant records.
  *
@@ -14,7 +14,7 @@ function participant_get_example() {
   );
 
   try{
-    $result = civicrm_api3('participant', 'get', $params);
+    $result = civicrm_api3('Participant', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -123,11 +123,10 @@ function participant_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetNestedEventGet
-* and can be found in
+* The test that created it is called "testGetNestedEventGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
 *
 * You can see the outcome of the API tests at
index f504ad29aae9ce55dc44bd3cfb43c9908dca8ea1..00d52347b76c52e7a77e443c2f3b3881d3a8986f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant_payment create API.
+ * Test Generated example demonstrating the ParticipantPayment.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function participant_payment_create_example() {
   );
 
   try{
-    $result = civicrm_api3('participant_payment', 'create', $params);
+    $result = civicrm_api3('ParticipantPayment', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -54,11 +54,10 @@ function participant_payment_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPaymentCreate
-* and can be found in
+* The test that created it is called "testPaymentCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php
 *
 * You can see the outcome of the API tests at
index 7c7d08d155a658d2609e613679da2a100623a399..7088a0d18e8807ce7bae36d16b96097f0f913f19 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant_payment delete API.
+ * Test Generated example demonstrating the ParticipantPayment.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function participant_payment_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('participant_payment', 'delete', $params);
+    $result = civicrm_api3('ParticipantPayment', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function participant_payment_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPaymentDelete
-* and can be found in
+* The test that created it is called "testPaymentDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php
 *
 * You can see the outcome of the API tests at
index 7b919f5934ac8f09f3fb72829b4b8893ba82a077..c119289a666da66820ecbf38aebfad2d0dc47981 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant_payment get API.
+ * Test Generated example demonstrating the ParticipantPayment.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function participant_payment_get_example() {
   );
 
   try{
-    $result = civicrm_api3('participant_payment', 'get', $params);
+    $result = civicrm_api3('ParticipantPayment', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -54,11 +54,10 @@ function participant_payment_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php
 *
 * You can see the outcome of the API tests at
index 5c317da65676402b8493fac296b9bdc9b4e9ac90..ed6ab392e5c83d188d54f4c83996d319217ce5c0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant_status_type create API.
+ * Test Generated example demonstrating the ParticipantStatusType.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function participant_status_type_create_example() {
   );
 
   try{
-    $result = civicrm_api3('participant_status_type', 'create', $params);
+    $result = civicrm_api3('ParticipantStatusType', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,10 +47,10 @@ function participant_status_type_create_expectedresult() {
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 16,
+    'id' => 17,
     'values' => array(
-      '16' => array(
-        'id' => '16',
+      '17' => array(
+        'id' => '17',
         'name' => 'test status',
         'label' => 'I am a test',
         'class' => 'Positive',
@@ -66,11 +66,10 @@ function participant_status_type_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateParticipantStatusType
-* and can be found in
+* The test that created it is called "testGetParticipantStatusType"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
 *
 * You can see the outcome of the API tests at
index 15d5c8b9cef158df81d5c50c9f741a321a306858..7b2a442791ba8eeb5c9f2c6fe7ffc2e7a99ce42c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant_status_type delete API.
+ * Test Generated example demonstrating the ParticipantStatusType.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function participant_status_type_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('participant_status_type', 'delete', $params);
+    $result = civicrm_api3('ParticipantStatusType', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function participant_status_type_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteParticipantStatusType
-* and can be found in
+* The test that created it is called "testDeleteParticipantStatusType"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
 *
 * You can see the outcome of the API tests at
index 461d54ae6f1c615d4b295945a67f6233d12a5bce..38c57c57fb17b502b7ece8f08ed6b9abc2b41bc5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using participant_status_type get API.
+ * Test Generated example demonstrating the ParticipantStatusType.get API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function participant_status_type_get_example() {
   );
 
   try{
-    $result = civicrm_api3('participant_status_type', 'get', $params);
+    $result = civicrm_api3('ParticipantStatusType', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -66,11 +66,10 @@ function participant_status_type_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetParticipantStatusType
-* and can be found in
+* The test that created it is called "testGetParticipantStatusType"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
 *
 * You can see the outcome of the API tests at
index a2cd8bd337757416c9213dfd19fb1a9d70b41fd9..8ca5613c926b1a4fe537ccd8a2970b31e9fc676d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using payment_processor create API.
+ * Test Generated example demonstrating the PaymentProcessor.create API.
  *
  * @return array
  *   API result array
@@ -15,7 +15,7 @@ function payment_processor_create_example() {
   );
 
   try{
-    $result = civicrm_api3('payment_processor', 'create', $params);
+    $result = civicrm_api3('PaymentProcessor', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -74,11 +74,10 @@ function payment_processor_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPaymentProcessorCreate
-* and can be found in
+* The test that created it is called "testPaymentProcessorCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTest.php
 *
 * You can see the outcome of the API tests at
index e979277b457f17e5967241e087525d45d3fd47d7..d726926a9a897916e339b398bb90b59929a711b5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using payment_processor delete API.
+ * Test Generated example demonstrating the PaymentProcessor.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function payment_processor_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('payment_processor', 'delete', $params);
+    $result = civicrm_api3('PaymentProcessor', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function payment_processor_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPaymentProcessorDelete
-* and can be found in
+* The test that created it is called "testPaymentProcessorDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTest.php
 *
 * You can see the outcome of the API tests at
index fd2c0662fa145a7df87e4d2cb21f1ea2eb3ceb24..d7803ec4045fbc39c697a18c0844d4fe24b3f890 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using payment_processor_type create API.
+ * Test Generated example demonstrating the PaymentProcessorType.create API.
  *
  * @return array
  *   API result array
@@ -16,7 +16,7 @@ function payment_processor_type_create_example() {
   );
 
   try{
-    $result = civicrm_api3('payment_processor_type', 'create', $params);
+    $result = civicrm_api3('PaymentProcessorType', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -77,11 +77,10 @@ function payment_processor_type_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPaymentProcessorTypeCreate
-* and can be found in
+* The test that created it is called "testPaymentProcessorTypeCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTypeTest.php
 *
 * You can see the outcome of the API tests at
index 31049b60703de0b1bcf1bbd9b05a4723a23e7604..49ac762dd3005e1627744f54fd92013cf2eabc53 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using payment_processor_type delete API.
+ * Test Generated example demonstrating the PaymentProcessorType.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function payment_processor_type_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('payment_processor_type', 'delete', $params);
+    $result = civicrm_api3('PaymentProcessorType', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function payment_processor_type_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPaymentProcessorTypeDelete
-* and can be found in
+* The test that created it is called "testPaymentProcessorTypeDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PaymentProcessorTypeTest.php
 *
 * You can see the outcome of the API tests at
index d3c6c688962a99509b21a0d7b898396a530de529..ea022ea735131d53387be7997a4fab973b8edeba 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using phone create API.
+ * Test Generated example demonstrating the Phone.create API.
  *
  * @return array
  *   API result array
@@ -15,7 +15,7 @@ function phone_create_example() {
   );
 
   try{
-    $result = civicrm_api3('phone', 'create', $params);
+    $result = civicrm_api3('Phone', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -64,11 +64,10 @@ function phone_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreatePhone
-* and can be found in
+* The test that created it is called "testCreatePhone"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PhoneTest.php
 *
 * You can see the outcome of the API tests at
index faf6a5a27fccb07beb92a13def6a61e4e7ba8e64..363998ab9b7f3efc6a5e9853b880be6f4d7699f9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using phone delete API.
+ * Test Generated example demonstrating the Phone.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function phone_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('phone', 'delete', $params);
+    $result = civicrm_api3('Phone', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function phone_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePhone
-* and can be found in
+* The test that created it is called "testDeletePhone"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PhoneTest.php
 *
 * You can see the outcome of the API tests at
index 0771ab25cfecd940911dca4343f2004348d5f056..f22274d9e26c9a0a7e01d05467b03a4d12345444 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using phone get API.
+ * Test Generated example demonstrating the Phone.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function phone_get_example() {
   );
 
   try{
-    $result = civicrm_api3('phone', 'get', $params);
+    $result = civicrm_api3('Phone', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function phone_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PhoneTest.php
 *
 * You can see the outcome of the API tests at
diff --git a/api/v3/examples/Phone/GetOptions.php b/api/v3/examples/Phone/GetOptions.php
new file mode 100644 (file)
index 0000000..3b236b6
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Test Generated example demonstrating the Phone.getoptions API.
+ *
+ * @return array
+ *   API result array
+ */
+function phone_getoptions_example() {
+  $params = array(
+    'field' => 'phone_type_id',
+  );
+
+  try{
+    $result = civicrm_api3('Phone', 'getoptions', $params);
+  }
+  catch (CiviCRM_API3_Exception $e) {
+    // Handle error here.
+    $errorMessage = $e->getMessage();
+    $errorCode = $e->getErrorCode();
+    $errorData = $e->getExtraParams();
+    return array(
+      'error' => $errorMessage,
+      'error_code' => $errorCode,
+      'error_data' => $errorData,
+    );
+  }
+
+  return $result;
+}
+
+/**
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ *   API result array
+ */
+function phone_getoptions_expectedresult() {
+
+  $expectedResult = array(
+    'is_error' => 0,
+    'version' => 3,
+    'count' => 5,
+    'values' => array(
+      '1' => 'Phone',
+      '2' => 'Mobile',
+      '3' => 'Fax',
+      '4' => 'Pager',
+      '5' => 'Voicemail',
+    ),
+  );
+
+  return $expectedResult;
+}
+
+/*
+* This example has been generated from the API test suite.
+* The test that created it is called "testPhoneType"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ConstantTest.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
+*/
index bf5e17d311f2bd0d535f53e6c610bed2f8732e7c..6bd0f386de0fa040e591dd1b447249e97794ae6b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge create API.
+ * Test Generated example demonstrating the Pledge.create API.
  *
  * @return array
  *   API result array
@@ -8,9 +8,9 @@
 function pledge_create_example() {
   $params = array(
     'contact_id' => 11,
-    'pledge_create_date' => '20150216',
-    'start_date' => '20150216',
-    'scheduled_date' => '20150218',
+    'pledge_create_date' => '20150222',
+    'start_date' => '20150222',
+    'scheduled_date' => '20150224',
     'amount' => '100',
     'pledge_status_id' => '2',
     'pledge_financial_type_id' => '1',
@@ -23,7 +23,7 @@ function pledge_create_example() {
   );
 
   try{
-    $result = civicrm_api3('pledge', 'create', $params);
+    $result = civicrm_api3('Pledge', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -85,11 +85,10 @@ function pledge_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreatePledge
-* and can be found in
+* The test that created it is called "testCreatePledge"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
 *
 * You can see the outcome of the API tests at
index 9ea54b09720a64712a652c6dcfdbc30f4e305306..02b53fdf620f783aec3ed57c8d74af151c7f21ab 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge delete API.
+ * Test Generated example demonstrating the Pledge.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function pledge_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('pledge', 'delete', $params);
+    $result = civicrm_api3('Pledge', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -49,11 +49,10 @@ function pledge_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePledgeUseID
-* and can be found in
+* The test that created it is called "testDeletePledgeUseID"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
 *
 * You can see the outcome of the API tests at
index 47f1131da2854e9693cd8cd4bd653f182a24f59e..0ac2a326450f79833a3cb0ebca89bcc257651445 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge get API.
+ * Test Generated example demonstrating the Pledge.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function pledge_get_example() {
   );
 
   try{
-    $result = civicrm_api3('pledge', 'get', $params);
+    $result = civicrm_api3('Pledge', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -50,10 +50,10 @@ function pledge_get_expectedresult() {
         'display_name' => 'Mr. Anthony Anderson II',
         'pledge_id' => '1',
         'pledge_amount' => '100.00',
-        'pledge_create_date' => '2015-02-16 00:00:00',
+        'pledge_create_date' => '2015-02-22 00:00:00',
         'pledge_status' => 'Pending',
         'pledge_total_paid' => '',
-        'pledge_next_pay_date' => '2015-02-18 00:00:00',
+        'pledge_next_pay_date' => '2015-02-24 00:00:00',
         'pledge_next_pay_amount' => '20.00',
         'pledge_outstanding_amount' => '',
         'pledge_financial_type' => 'Donation',
@@ -71,11 +71,10 @@ function pledge_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetPledge
-* and can be found in
+* The test that created it is called "testGetPledge"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
 *
 * You can see the outcome of the API tests at
index ee4847a390361934b0bd1d41a345da3dbca89ecd..6e52589e8e42deded9492fd88a52f2201a8d7453 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge get API.
+ * Test Generated example demonstrating the Pledge.get API.
  *
  * demonstrates high date filter
  *
@@ -9,11 +9,11 @@
  */
 function pledge_get_example() {
   $params = array(
-    'pledge_start_date_high' => '20150214114707',
+    'pledge_start_date_high' => '20150220231942',
   );
 
   try{
-    $result = civicrm_api3('pledge', 'get', $params);
+    $result = civicrm_api3('Pledge', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -52,7 +52,7 @@ function pledge_get_expectedresult() {
         'display_name' => 'Mr. Anthony Anderson II',
         'pledge_id' => '2',
         'pledge_amount' => '100.00',
-        'pledge_create_date' => '2015-02-16 00:00:00',
+        'pledge_create_date' => '2015-02-22 00:00:00',
         'pledge_status' => 'Overdue',
         'pledge_total_paid' => '',
         'pledge_next_pay_date' => '2014-03-07 00:00:00',
@@ -73,11 +73,10 @@ function pledge_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testPledgeGetReturnFilters
-* and can be found in
+* The test that created it is called "testPledgeGetReturnFilters"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgeTest.php
 *
 * You can see the outcome of the API tests at
index 82212aa93821eb078af6ed9b8355f782605ab239..1e8c21e3eb43c79fe0bf6d18dd8e3c96ac03b3dd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge_payment create API.
+ * Test Generated example demonstrating the PledgePayment.create API.
  *
  * @return array
  *   API result array
@@ -15,7 +15,7 @@ function pledge_payment_create_example() {
   );
 
   try{
-    $result = civicrm_api3('pledge_payment', 'create', $params);
+    $result = civicrm_api3('PledgePayment', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -64,11 +64,10 @@ function pledge_payment_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreatePledgePayment
-* and can be found in
+* The test that created it is called "testCreatePledgePayment"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
 *
 * You can see the outcome of the API tests at
index 8a2eb816af1aab7a711cbfdefbd908b5e7d49be5..d54893ba45d6583ff0144f8a445fabdf82a0c32d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge_payment delete API.
+ * Test Generated example demonstrating the PledgePayment.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function pledge_payment_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('pledge_payment', 'delete', $params);
+    $result = civicrm_api3('PledgePayment', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -49,11 +49,10 @@ function pledge_payment_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePledgePayment
-* and can be found in
+* The test that created it is called "testDeletePledgePayment"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
 *
 * You can see the outcome of the API tests at
index babc04bab72aa7eccdaaca14bea9c696c37c10c9..17f2e27c273eb420003f010764d82a80374ca2e0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge_payment get API.
+ * Test Generated example demonstrating the PledgePayment.get API.
  *
  * @return array
  *   API result array
@@ -9,7 +9,7 @@ function pledge_payment_get_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('pledge_payment', 'get', $params);
+    $result = civicrm_api3('PledgePayment', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -90,11 +90,10 @@ function pledge_payment_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetPledgePayment
-* and can be found in
+* The test that created it is called "testGetPledgePayment"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
 *
 * You can see the outcome of the API tests at
index 079796c35c0f6a4cf24abd60951c56701ad2ba01..eaa3178ceec6a37964d698d00b1628b540bef958 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using pledge_payment update API.
+ * Test Generated example demonstrating the PledgePayment.update API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function pledge_payment_update_example() {
   );
 
   try{
-    $result = civicrm_api3('pledge_payment', 'update', $params);
+    $result = civicrm_api3('PledgePayment', 'update', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,11 +61,10 @@ function pledge_payment_update_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testUpdatePledgePayment
-* and can be found in
+* The test that created it is called "testUpdatePledgePayment"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PledgePaymentTest.php
 *
 * You can see the outcome of the API tests at
index 5b12fd34172d672c71d04e8eb32b8a1dec4f7f68..8339479cb382acf2701b24191ebeef8971439f98 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_field create API.
+ * Test Generated example demonstrating the PriceField.create API.
  *
  * @return array
  *   API result array
@@ -16,7 +16,7 @@ function price_field_create_example() {
   );
 
   try{
-    $result = civicrm_api3('price_field', 'create', $params);
+    $result = civicrm_api3('PriceField', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -72,11 +72,10 @@ function price_field_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreatePriceField
-* and can be found in
+* The test that created it is called "testCreatePriceField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldTest.php
 *
 * You can see the outcome of the API tests at
index 931d43e06650b874ff564f08f4d514f1df5e1600..3d23332a4471d8ee0fdbb2fafbda8848ee2c92b2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_field delete API.
+ * Test Generated example demonstrating the PriceField.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function price_field_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('price_field', 'delete', $params);
+    $result = civicrm_api3('PriceField', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function price_field_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePriceField
-* and can be found in
+* The test that created it is called "testDeletePriceField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldTest.php
 *
 * You can see the outcome of the API tests at
index 69150e8461402adf52279c10820799b3c4e2286d..953f6d195752075f3eed74defce60d8c0e78a480 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_field get API.
+ * Test Generated example demonstrating the PriceField.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function price_field_get_example() {
   );
 
   try{
-    $result = civicrm_api3('price_field', 'get', $params);
+    $result = civicrm_api3('PriceField', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -62,11 +62,10 @@ function price_field_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetBasicPriceField
-* and can be found in
+* The test that created it is called "testGetBasicPriceField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldTest.php
 *
 * You can see the outcome of the API tests at
index cd48bda29d793d50dd50fcc21859a583256c2764..567c0b9d06d6f815b5faa1bb228bab6df82c8909 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_field_value create API.
+ * Test Generated example demonstrating the PriceFieldValue.create API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function price_field_value_create_example() {
   );
 
   try{
-    $result = civicrm_api3('price_field_value', 'create', $params);
+    $result = civicrm_api3('PriceFieldValue', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -73,11 +73,10 @@ function price_field_value_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreatePriceFieldValuewithMultipleTerms
-* and can be found in
+* The test that created it is called "testCreatePriceFieldValuewithMultipleTerms"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
 *
 * You can see the outcome of the API tests at
index 0bb398056949650f8f9aa43d29af1a6cef335718..1eb72a66d3b87470416eb2341d20a4584eb4fb23 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_field_value delete API.
+ * Test Generated example demonstrating the PriceFieldValue.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function price_field_value_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('price_field_value', 'delete', $params);
+    $result = civicrm_api3('PriceFieldValue', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function price_field_value_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePriceFieldValue
-* and can be found in
+* The test that created it is called "testDeletePriceFieldValue"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
 *
 * You can see the outcome of the API tests at
index 73c9b13d18dcc52e270cc092711b1049feb53260..1944cde832a0ca12509e728bf64dde60a628a0ad 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_field_value get API.
+ * Test Generated example demonstrating the PriceFieldValue.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function price_field_value_get_example() {
   );
 
   try{
-    $result = civicrm_api3('price_field_value', 'get', $params);
+    $result = civicrm_api3('PriceFieldValue', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -60,11 +60,10 @@ function price_field_value_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetBasicPriceFieldValue
-* and can be found in
+* The test that created it is called "testGetBasicPriceFieldValue"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceFieldValueTest.php
 *
 * You can see the outcome of the API tests at
index 4fd0398f89b04a2bc8f04fab73f6346d825f99ec..52734d083ed64193fbad3cfbb79d878f78611ffa 100644 (file)
@@ -1,24 +1,21 @@
 <?php
 /**
- * Test Generated example of using price_set create API.
+ * Test Generated example demonstrating the PriceSet.create API.
  *
  * @return array
  *   API result array
  */
 function price_set_create_example() {
   $params = array(
-    'name' => 'some_price_set',
-    'title' => 'Some Price Set',
-    'is_active' => 1,
-    'financial_type_id' => 1,
-    'extends' => array(
-      '0' => 1,
-      '1' => 2,
-    ),
+    'entity_table' => 'civicrm_event',
+    'entity_id' => 1,
+    'name' => 'event price',
+    'title' => 'event price',
+    'extends' => 1,
   );
 
   try{
-    $result = civicrm_api3('price_set', 'create', $params);
+    $result = civicrm_api3('PriceSet', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -47,22 +44,19 @@ function price_set_create_expectedresult() {
     'is_error' => 0,
     'version' => 3,
     'count' => 1,
-    'id' => 16,
+    'id' => 18,
     'values' => array(
-      '16' => array(
-        'id' => '16',
+      '18' => array(
+        'id' => '18',
         'domain_id' => '',
-        'name' => 'some_price_set',
-        'title' => 'Some Price Set',
-        'is_active' => '1',
+        'name' => 'event price',
+        'title' => 'event price',
+        'is_active' => '',
         'help_pre' => '',
         'help_post' => '',
         'javascript' => '',
-        'extends' => array(
-          '0' => '1',
-          '1' => '2',
-        ),
-        'financial_type_id' => '1',
+        'extends' => '1',
+        'financial_type_id' => '',
         'is_quick_config' => '',
         'is_reserved' => '',
       ),
@@ -72,11 +66,10 @@ function price_set_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreatePriceSetForEventAndContribution
-* and can be found in
+* The test that created it is called "testEventPriceSet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceSetTest.php
 *
 * You can see the outcome of the API tests at
index efe0a03815c1448e251ad22f2e139ee1427208e3..5360087383ff66d2ead599b7ea5573966d21d6cc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_set delete API.
+ * Test Generated example demonstrating the PriceSet.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function price_set_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('price_set', 'delete', $params);
+    $result = civicrm_api3('PriceSet', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function price_set_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePriceSet
-* and can be found in
+* The test that created it is called "testDeletePriceSet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceSetTest.php
 *
 * You can see the outcome of the API tests at
index e6004c7d4543c54488bac4b01b72375537a03957..b5468e8277c4500fe50ef7ec387a6152a6af5813 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using price_set get API.
+ * Test Generated example demonstrating the PriceSet.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function price_set_get_example() {
   );
 
   try{
-    $result = civicrm_api3('price_set', 'get', $params);
+    $result = civicrm_api3('PriceSet', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -58,11 +58,10 @@ function price_set_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetBasicPriceSet
-* and can be found in
+* The test that created it is called "testGetBasicPriceSet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/PriceSetTest.php
 *
 * You can see the outcome of the API tests at
index 0d1359c66370283f9ddf13689a3e5034a7a58c12..60c8da1e7e5c8d34d88a6401c3c631e8a21e359c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using profile apply API.
+ * Test Generated example demonstrating the Profile.apply API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function profile_apply_example() {
   );
 
   try{
-    $result = civicrm_api3('profile', 'apply', $params);
+    $result = civicrm_api3('Profile', 'apply', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -85,11 +85,10 @@ function profile_apply_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testProfileApply
-* and can be found in
+* The test that created it is called "testProfileApply"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
 *
 * You can see the outcome of the API tests at
index dbcb37e76b89a3772e26533f9d4d50a87dec55c6..415ba5cde918ec9a56babfdca4099a1042f96599 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using profile get API.
+ * Test Generated example demonstrating the Profile.get API.
  *
  * @return array
  *   API result array
@@ -16,7 +16,7 @@ function profile_get_example() {
   );
 
   try{
-    $result = civicrm_api3('profile', 'get', $params);
+    $result = civicrm_api3('Profile', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -83,11 +83,10 @@ function profile_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testProfileGetMultiple
-* and can be found in
+* The test that created it is called "testProfileGetMultiple"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
 *
 * You can see the outcome of the API tests at
index 7a4eccdfe5c8cbc427f406c84422b492beeab972..81ec33c5c64501febca9cf5c20950085d8d796d3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using profile getfields API.
+ * Test Generated example demonstrating the Profile.getfields API.
  *
  * demonstrates retrieving profile fields passing in an id
  *
@@ -14,7 +14,7 @@ function profile_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('profile', 'getfields', $params);
+    $result = civicrm_api3('Profile', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -229,11 +229,10 @@ function profile_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFields
-* and can be found in
+* The test that created it is called "testGetFields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
 *
 * You can see the outcome of the API tests at
index c5db62a72ad0a5ff322d694c5fe7cba3b4cd4892..03c6ef75d730991d92f831a32ed1d26e3b0c3052 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using profile submit API.
+ * Test Generated example demonstrating the Profile.submit API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function profile_submit_example() {
   );
 
   try{
-    $result = civicrm_api3('profile', 'submit', $params);
+    $result = civicrm_api3('Profile', 'submit', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -106,11 +106,10 @@ function profile_submit_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testProfileSubmit
-* and can be found in
+* The test that created it is called "testProfileSubmit"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
 *
 * You can see the outcome of the API tests at
index 434d53148271745903c4f6d6b027208cdbae19e3..2a04935a837e26e50e985805d54efe21507f6d3f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship get API.
+ * Test Generated example demonstrating the Relationship.get API.
  *
  * Demonstrates use of BETWEEN filter.
  *
@@ -18,7 +18,7 @@ function relationship_get_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'get', $params);
+    $result = civicrm_api3('Relationship', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -87,11 +87,10 @@ function relationship_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetTypeOperators
-* and can be found in
+* The test that created it is called "testGetTypeOperators"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index bcdf527463dd021144b98bc88dd148fd0a9f5339..1c4c1586f189e044104d5a22bcce162412284620 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship create API.
+ * Test Generated example demonstrating the Relationship.create API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function relationship_create_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'create', $params);
+    $result = civicrm_api3('Relationship', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -67,11 +67,10 @@ function relationship_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testRelationshipCreate
-* and can be found in
+* The test that created it is called "testRelationshipCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index 54d222ee151a3e80954b94ea2ebd6deff6cbcdf3..1e8cafd512ec553a51106e49fbd556a95f3c25e6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship delete API.
+ * Test Generated example demonstrating the Relationship.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function relationship_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'delete', $params);
+    $result = civicrm_api3('Relationship', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function relationship_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testRelationshipDelete
-* and can be found in
+* The test that created it is called "testRelationshipDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index 26bde3034842c830dcc8b038d25fce6aebfab9b1..b1a865ccb105b5e123f2811629446e64f8d66427 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship get API.
+ * Test Generated example demonstrating the Relationship.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function relationship_get_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'get', $params);
+    $result = civicrm_api3('Relationship', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,11 +61,10 @@ function relationship_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetWithCustom
-* and can be found in
+* The test that created it is called "testGetWithCustom"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index c7f25e3915d49b5dee31ed6b43760f00d58be1c4..afbd42c46594946d19139819316f590e16b26a6e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship get API.
+ * Test Generated example demonstrating the Relationship.get API.
  *
  * Demonstrates use of IN filter.
  *
@@ -18,7 +18,7 @@ function relationship_get_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'get', $params);
+    $result = civicrm_api3('Relationship', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -76,11 +76,10 @@ function relationship_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetTypeOperators
-* and can be found in
+* The test that created it is called "testGetTypeOperators"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index e6a2fea178142523cbcb0b1feefaaabfa9ea3abf..091ea47cec2bedfc8d8cd4bf47e0fcaee3df4f6d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship get API.
+ * Test Generated example demonstrating the Relationship.get API.
  *
  * Demonstrates use of Not BETWEEN filter.
  *
@@ -18,7 +18,7 @@ function relationship_get_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'get', $params);
+    $result = civicrm_api3('Relationship', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -66,11 +66,10 @@ function relationship_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetTypeOperators
-* and can be found in
+* The test that created it is called "testGetTypeOperators"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index bed39cd0655233444f9fd18625a24f15b91220b3..024c3952e869162d00e4f06690d9aac1d359dc88 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship get API.
+ * Test Generated example demonstrating the Relationship.get API.
  *
  * Demonstrates use of NOT IN filter.
  *
@@ -18,7 +18,7 @@ function relationship_get_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'get', $params);
+    $result = civicrm_api3('Relationship', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -76,11 +76,10 @@ function relationship_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetTypeOperators
-* and can be found in
+* The test that created it is called "testGetTypeOperators"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index 3a145bad34823e844ab1b795f760d7a9014aad32..d12bccc3f97204dc54295f0db79234e7099510a5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship get API.
+ * Test Generated example demonstrating the Relationship.get API.
  *
  * Demonstrates is_current filter.
  *
@@ -15,7 +15,7 @@ function relationship_get_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship', 'get', $params);
+    $result = civicrm_api3('Relationship', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -63,11 +63,10 @@ function relationship_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetIsCurrent
-* and can be found in
+* The test that created it is called "testGetIsCurrent"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTest.php
 *
 * You can see the outcome of the API tests at
index cbb9eff07fd40a02b5cfb7e4f70c3f58c1d133d1..2d458c4dbf02e1cb1c41051399e614a8c704266d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship_type create API.
+ * Test Generated example demonstrating the RelationshipType.create API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function relationship_type_create_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship_type', 'create', $params);
+    $result = civicrm_api3('RelationshipType', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -68,11 +68,10 @@ function relationship_type_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testRelationshipTypeCreate
-* and can be found in
+* The test that created it is called "testRelationshipTypeCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTypeTest.php
 *
 * You can see the outcome of the API tests at
index e418077a651c4b980f974fdb1e49271befb3c4a2..6b1dd50373021ab1bcdcee64d14db5a7a3557ed6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using relationship_type delete API.
+ * Test Generated example demonstrating the RelationshipType.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function relationship_type_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('relationship_type', 'delete', $params);
+    $result = civicrm_api3('RelationshipType', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function relationship_type_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testRelationshipTypeDelete
-* and can be found in
+* The test that created it is called "testRelationshipTypeDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/RelationshipTypeTest.php
 *
 * You can see the outcome of the API tests at
index 660a3fe23ac9181bc727ce896286c4a069bb0602..50d64613338d0e724a4f2af91ffdf41d107c9e70 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using report_template getrows API.
+ * Test Generated example demonstrating the ReportTemplate.getrows API.
  *
  * Retrieve rows from a report template (optionally providing the instance_id).
  *
@@ -19,7 +19,7 @@ function report_template_getrows_example() {
   );
 
   try{
-    $result = civicrm_api3('report_template', 'getrows', $params);
+    $result = civicrm_api3('ReportTemplate', 'getrows', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -70,11 +70,10 @@ function report_template_getrows_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testReportTemplateGetRowsContactSummary
-* and can be found in
+* The test that created it is called "testReportTemplateGetRowsContactSummary"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
 *
 * You can see the outcome of the API tests at
index eb62f9938a28cd12b4ee746fc9bcec554209511f..93e6fc6d99b4b5e51dbb8656befc39d366fb8978 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using report_template getstatistics API.
+ * Test Generated example demonstrating the ReportTemplate.getstatistics API.
  *
  * Get Statistics from a report (note there isn't much data to get in the test DB).
  *
@@ -13,7 +13,7 @@ function report_template_getstatistics_example() {
   );
 
   try{
-    $result = civicrm_api3('report_template', 'getstatistics', $params);
+    $result = civicrm_api3('ReportTemplate', 'getstatistics', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -56,11 +56,10 @@ function report_template_getstatistics_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testReportTemplateGetStatisticsAllReports
-* and can be found in
+* The test that created it is called "testReportTemplateGetStatisticsAllReports"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
 *
 * You can see the outcome of the API tests at
index 6436b6f8dce9a63f034ec8d4b852469b1364ac3e..466890049cfd068a2b8245e18d50d3fac2571339 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting create API.
+ * Test Generated example demonstrating the Setting.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function setting_create_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'create', $params);
+    $result = civicrm_api3('Setting', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -52,11 +52,10 @@ function setting_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSetting
-* and can be found in
+* The test that created it is called "testCreateSetting"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 2e54b93bf2c83b3a177715efbd193e977902e497..ec2115963355a78e42cc667429417a3ae23d63c0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting create API.
+ * Test Generated example demonstrating the Setting.create API.
  *
  * Shows setting a variable for all domains.
  *
@@ -14,7 +14,7 @@ function setting_create_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'create', $params);
+    $result = civicrm_api3('Setting', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function setting_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSettingMultipleDomains
-* and can be found in
+* The test that created it is called "testCreateSettingMultipleDomains"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 1188945550bb7da6e81f14f033e08082fac599f8..a43b968efca8e906075ad68f3aae67b5198c306b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting create API.
+ * Test Generated example demonstrating the Setting.create API.
  *
  * Shows setting a variable for a current domain.
  *
@@ -13,7 +13,7 @@ function setting_create_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'create', $params);
+    $result = civicrm_api3('Setting', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -53,11 +53,10 @@ function setting_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSetting
-* and can be found in
+* The test that created it is called "testCreateSetting"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 2a859c38ddb66017b799fa064542eea18665ed63..e889f6c3a070346c726bfbd92d044b7737ca0986 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting create API.
+ * Test Generated example demonstrating the Setting.create API.
  *
  * Shows setting a variable for specified domains.
  *
@@ -17,7 +17,7 @@ function setting_create_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'create', $params);
+    $result = civicrm_api3('Setting', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function setting_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSettingMultipleDomains
-* and can be found in
+* The test that created it is called "testCreateSettingMultipleDomains"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 4111d4a8e92d210610e1d8b18233ddeb7baa52bb..270c1e5e5484132d0a8da230a5b11cf2db02d2b9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting get API.
+ * Test Generated example demonstrating the Setting.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function setting_get_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'get', $params);
+    $result = civicrm_api3('Setting', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -52,11 +52,10 @@ function setting_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSetting
-* and can be found in
+* The test that created it is called "testGetSetting"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 045e9de61cc11cd30405c620d4d35059931691a0..4aab2582fa19878c626e700763cb1a0ecfbf0fd5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting Get API.
+ * Test Generated example demonstrating the Setting.get API.
  *
  * Shows getting a variable for all domains.
  *
@@ -14,7 +14,7 @@ function setting_get_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'Get', $params);
+    $result = civicrm_api3('Setting', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function setting_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSettingMultipleDomains
-* and can be found in
+* The test that created it is called "testCreateSettingMultipleDomains"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 98931bb9c599d56a7ca35af9942fcc8a192600fd..3cb02ca81398b28ecf634bf5fbcb28b80989145f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting getdefaults API.
+ * Test Generated example demonstrating the Setting.getdefaults API.
  *
  * Gets defaults setting a variable for a given domain - if no domain is set current is assumed.
  *
@@ -13,7 +13,7 @@ function setting_getdefaults_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'getdefaults', $params);
+    $result = civicrm_api3('Setting', 'getdefaults', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -58,11 +58,10 @@ function setting_getdefaults_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetDefaults
-* and can be found in
+* The test that created it is called "testGetDefaults"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 9c9cabb8f645aca551bc5cf1a084d8ec6c3820b6..87a74e7be09fafb9c9f89fec0f1172dd907c0d97 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting getfields API.
+ * Test Generated example demonstrating the Setting.getfields API.
  *
  * Demonstrate return from getfields - see subfolder for variants
  *
@@ -11,7 +11,7 @@ function setting_getfields_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('setting', 'getfields', $params);
+    $result = civicrm_api3('Setting', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -1623,11 +1623,10 @@ function setting_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFields
-* and can be found in
+* The test that created it is called "testGetFields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 8901b319bac5972ec90effb822a5a3cb3a576082..5ace770b00abde215966fd6915f041a66ee04f8b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting get API.
+ * Test Generated example demonstrating the Setting.get API.
  *
  * Shows getting a variable for a current domain.
  *
@@ -13,7 +13,7 @@ function setting_get_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'get', $params);
+    $result = civicrm_api3('Setting', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -53,11 +53,10 @@ function setting_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSetting
-* and can be found in
+* The test that created it is called "testGetSetting"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 989831e277dbd018636f7fb54c42418f7ecdd298..683e6618b3eb5eabacb0dd0c7428397f903be688 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting Get API.
+ * Test Generated example demonstrating the Setting.get API.
  *
  * Shows getting a variable for specified domains.
  *
@@ -19,7 +19,7 @@ function setting_get_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'Get', $params);
+    $result = civicrm_api3('Setting', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,11 +61,10 @@ function setting_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSettingMultipleDomains
-* and can be found in
+* The test that created it is called "testCreateSettingMultipleDomains"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 9f0a5b33a226ab30e21e0f42cf963d6d0a58bf50..8ee9aa41f253cf2617b76e6af33ad1468fb3b301 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting getvalue API.
+ * Test Generated example demonstrating the Setting.getvalue API.
  *
  * Demonstrates getvalue action - intended for runtime use as better caching than get.
  *
@@ -14,7 +14,7 @@ function setting_getvalue_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'getvalue', $params);
+    $result = civicrm_api3('Setting', 'getvalue', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -44,11 +44,10 @@ function setting_getvalue_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetValue
-* and can be found in
+* The test that created it is called "testGetValue"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index 2dedceea2fa963f5262ea7d6c75417b3a061bd3d..9eb77d993e15245e6b153ea54302e0d08eedfe76 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using setting revert API.
+ * Test Generated example demonstrating the Setting.revert API.
  *
  * Demonstrates reverting a parameter to default value.
  *
@@ -13,7 +13,7 @@ function setting_revert_example() {
   );
 
   try{
-    $result = civicrm_api3('setting', 'revert', $params);
+    $result = civicrm_api3('Setting', 'revert', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -64,11 +64,10 @@ function setting_revert_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testRevert
-* and can be found in
+* The test that created it is called "testRevert"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SettingTest.php
 *
 * You can see the outcome of the API tests at
index eecfd4a1bb57224282f0a7d693cb9141c5251cf7..2a218305a4f753a58f45d50139d78d6331c20c08 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using survey get API.
+ * Test Generated example demonstrating the Survey.get API.
  *
  * Demonstrates get + delete in the same call.
  *
@@ -14,7 +14,7 @@ function survey_get_example() {
   );
 
   try{
-    $result = civicrm_api3('survey', 'get', $params);
+    $result = civicrm_api3('Survey', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -69,11 +69,10 @@ function survey_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSurveyChainDelete
-* and can be found in
+* The test that created it is called "testGetSurveyChainDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
 *
 * You can see the outcome of the API tests at
index 8c4a3415f4ba4c0c334562758a3e1ad50f009174..11a84829142f611555f30d67fc7faabdea8d5731 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using survey create API.
+ * Test Generated example demonstrating the Survey.create API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function survey_create_example() {
   );
 
   try{
-    $result = civicrm_api3('survey', 'create', $params);
+    $result = civicrm_api3('Survey', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -73,11 +73,10 @@ function survey_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateSurvey
-* and can be found in
+* The test that created it is called "testCreateSurvey"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
 *
 * You can see the outcome of the API tests at
index bccd1adf5a7bdae18335318ef3d2eaa3f4f8f2b6..b2b7f6d1a6d860201f7235f60f3291cbd106a9ba 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using survey delete API.
+ * Test Generated example demonstrating the Survey.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function survey_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('survey', 'delete', $params);
+    $result = civicrm_api3('Survey', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function survey_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteSurvey
-* and can be found in
+* The test that created it is called "testDeleteSurvey"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
 *
 * You can see the outcome of the API tests at
index f61a6c90bb3d5778c61fffbcf821e1bfa60ff6f9..43038c18303d61f0ac3012b1315dcb113a925342 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using survey get API.
+ * Test Generated example demonstrating the Survey.get API.
  *
  * @return array
  *   API result array
@@ -14,7 +14,7 @@ function survey_get_example() {
   );
 
   try{
-    $result = civicrm_api3('survey', 'get', $params);
+    $result = civicrm_api3('Survey', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -63,11 +63,10 @@ function survey_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSurvey
-* and can be found in
+* The test that created it is called "testGetSurvey"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
 *
 * You can see the outcome of the API tests at
index 4f89c96afaca97f1f1b6b199b03ef7b80777be93..b07f6a770f730ece8992604d74a0b2bbeacc2ccb 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /**
- * Test Generated example of using survey_respondant get API.
+ * Test Generated example demonstrating the SurveyRespondant.get API.
  *
  * @deprecated
- * The survey_respondant api is not currently supported.
+ * The SurveyRespondant api is not currently supported.
  *
  * @return array
  *   API result array
@@ -15,7 +15,7 @@ function survey_respondant_get_example() {
   );
 
   try{
-    $result = civicrm_api3('survey_respondant', 'get', $params);
+    $result = civicrm_api3('SurveyRespondant', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -45,17 +45,16 @@ function survey_respondant_get_expectedresult() {
     'version' => 3,
     'count' => 0,
     'values' => array(),
-    'deprecated' => 'The survey_respondant api is not currently supported.',
+    'deprecated' => 'The SurveyRespondant api is not currently supported.',
   );
 
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSurveyRespondants
-* and can be found in
+* The test that created it is called "testGetSurveyRespondants"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyRespondantTest.php
 *
 * You can see the outcome of the API tests at
index e1f397ec4ad678e0afd42cca82c8b0fced6d2fdc..0d124c21444f77aeb58bf1801ddbd1648108dad8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using system flush API.
+ * Test Generated example demonstrating the System.flush API.
  *
  * Flush all system caches
  *
@@ -11,7 +11,7 @@ function system_flush_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('system', 'flush', $params);
+    $result = civicrm_api3('System', 'flush', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function system_flush_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testFlush
-* and can be found in
+* The test that created it is called "testFlush"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SystemTest.php
 *
 * You can see the outcome of the API tests at
index 01c2ece535824104ee2ff90ef6a0fefef2d3ac8e..503eacabdb8a1eec2fd0811b052e0c06475c63f2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using tag create API.
+ * Test Generated example demonstrating the Tag.create API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function tag_create_example() {
   );
 
   try{
-    $result = civicrm_api3('tag', 'create', $params);
+    $result = civicrm_api3('Tag', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -61,11 +61,10 @@ function tag_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
 *
 * You can see the outcome of the API tests at
index ef41b0cc5c47f759f11af0bd9857c4dd9c8eda1a..b1112ad56bd2318e101a3ff58a4ac26776ce5a5f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using tag delete API.
+ * Test Generated example demonstrating the Tag.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function tag_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('tag', 'delete', $params);
+    $result = civicrm_api3('Tag', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function tag_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testTagDeleteCorrectSyntax
-* and can be found in
+* The test that created it is called "testTagDeleteCorrectSyntax"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
 *
 * You can see the outcome of the API tests at
index 248f35fcc30b6fb02feb1bfb50bcf002eb77b9f3..8860a11c72e9cd09380be3557a3af021e1cea8ff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using tag get API.
+ * Test Generated example demonstrating the Tag.get API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function tag_get_example() {
   );
 
   try{
-    $result = civicrm_api3('tag', 'get', $params);
+    $result = civicrm_api3('Tag', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function tag_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGet
-* and can be found in
+* The test that created it is called "testGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
 *
 * You can see the outcome of the API tests at
similarity index 94%
rename from api/v3/examples/Tag/Getfields.php
rename to api/v3/examples/Tag/GetFields.php
index 367e755465bca0706db8196456eaa6aabf1b1386..eb38f1819234732bf5d354d753b2205c8f760e4c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using tag getfields API.
+ * Test Generated example demonstrating the Tag.getfields API.
  *
  * Demonstrate use of getfields to interrogate api.
  *
@@ -13,7 +13,7 @@ function tag_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('tag', 'getfields', $params);
+    $result = civicrm_api3('Tag', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -125,11 +125,10 @@ function tag_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testTagGetfields
-* and can be found in
+* The test that created it is called "testTagGetfields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
 *
 * You can see the outcome of the API tests at
index f0f4f28a29c7042509e5ad79274699e5e36f21c7..9dd6c6ebc83eff00cc36784199a53619c351e90a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using tag getlist API.
+ * Test Generated example demonstrating the Tag.getlist API.
  *
  * Demonstrates use of api.getlist for autocomplete and quicksearch applications.
  *
@@ -16,7 +16,7 @@ function tag_getlist_example() {
   );
 
   try{
-    $result = civicrm_api3('tag', 'getlist', $params);
+    $result = civicrm_api3('Tag', 'getlist', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -65,11 +65,10 @@ function tag_getlist_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testTagGetList
-* and can be found in
+* The test that created it is called "testTagGetList"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
 *
 * You can see the outcome of the API tests at
similarity index 89%
rename from api/v3/examples/Tag/getReturnArray.php
rename to api/v3/examples/Tag/GetReturnArray.php
index d49a8ba189b7d5a043660119882d239b0cc386d0..e3cb5b396bc572afafc8d60b5845a892133ac5fe 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using tag get API.
+ * Test Generated example demonstrating the Tag.get API.
  *
  * Demonstrates use of Return as an array.
  *
@@ -17,7 +17,7 @@ function tag_get_example() {
   );
 
   try{
-    $result = civicrm_api3('tag', 'get', $params);
+    $result = civicrm_api3('Tag', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -58,11 +58,10 @@ function tag_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetReturnArray
-* and can be found in
+* The test that created it is called "testGetReturnArray"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
 *
 * You can see the outcome of the API tests at
index 8e8feac1a3d71b206fa09c97c15cc40d80588ba5..ec39ee0013833f21a10c5ba5d5be1f6cec1efdd0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_field create API.
+ * Test Generated example demonstrating the UFField.create API.
  *
  * @return array
  *   API result array
@@ -20,7 +20,7 @@ function uf_field_create_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_field', 'create', $params);
+    $result = civicrm_api3('UFField', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -78,11 +78,10 @@ function uf_field_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateUFField
-* and can be found in
+* The test that created it is called "testCreateUFField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
 *
 * You can see the outcome of the API tests at
index 6e6d90b46abdc1fc9d0d60416551d13957340733..a766ac75845927c1a58e807ab67aef88c5ad7319 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_field delete API.
+ * Test Generated example demonstrating the UFField.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function uf_field_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_field', 'delete', $params);
+    $result = civicrm_api3('UFField', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function uf_field_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteUFField
-* and can be found in
+* The test that created it is called "testDeleteUFField"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
 *
 * You can see the outcome of the API tests at
index 72a9f23f894acb9efe4d50c54545679c143a344a..9c52c59d20418abb53adedf7cd4b6482b0c0aa72 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_field get API.
+ * Test Generated example demonstrating the UFField.get API.
  *
  * @return array
  *   API result array
@@ -9,7 +9,7 @@ function uf_field_get_example() {
   $params = array();
 
   try{
-    $result = civicrm_api3('uf_field', 'get', $params);
+    $result = civicrm_api3('UFField', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -63,11 +63,10 @@ function uf_field_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetUFFieldSuccess
-* and can be found in
+* The test that created it is called "testGetUFFieldSuccess"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
 *
 * You can see the outcome of the API tests at
index 70451d9a95f9046eba70a256317569c97fff2791..fc95c904393727c1eba414f1181636886d60c6ef 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_field replace API.
+ * Test Generated example demonstrating the UFField.replace API.
  *
  * @return array
  *   API result array
@@ -44,7 +44,7 @@ function uf_field_replace_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_field', 'replace', $params);
+    $result = civicrm_api3('UFField', 'replace', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -143,11 +143,10 @@ function uf_field_replace_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testReplaceUFFields
-* and can be found in
+* The test that created it is called "testReplaceUFFields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
 *
 * You can see the outcome of the API tests at
index 5798664754815d3f4ee72b14dc3091e532dfde1e..fdf7ada9352970353a5dab2f30ffa29e62dc2a8d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_group create API.
+ * Test Generated example demonstrating the UFGroup.create API.
  *
  * @return array
  *   API result array
@@ -30,7 +30,7 @@ function uf_group_create_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_group', 'create', $params);
+    $result = civicrm_api3('UFGroup', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -92,11 +92,10 @@ function uf_group_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testUFGroupCreate
-* and can be found in
+* The test that created it is called "testUFGroupCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
 *
 * You can see the outcome of the API tests at
index bafd44f5bdf1eca508b8f3ae5a3812adfd36b99a..c2be5ea33089e6c08deba871c5224951e41f4c0a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_group delete API.
+ * Test Generated example demonstrating the UFGroup.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function uf_group_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_group', 'delete', $params);
+    $result = civicrm_api3('UFGroup', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function uf_group_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testUFGroupDelete
-* and can be found in
+* The test that created it is called "testUFGroupDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
 *
 * You can see the outcome of the API tests at
index 87103511b9fbaff9340cdab7439188c170538deb..b35be5d2ba09cf178e61b28c018b766571a188df 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_group get API.
+ * Test Generated example demonstrating the UFGroup.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function uf_group_get_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_group', 'get', $params);
+    $result = civicrm_api3('UFGroup', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -72,11 +72,10 @@ function uf_group_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testUFGroupGet
-* and can be found in
+* The test that created it is called "testUFGroupGet"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFGroupTest.php
 *
 * You can see the outcome of the API tests at
index bbfcee5e1c213135a8063124f12ab4a6df2a359b..fa380d97d2c23f135424851bb4cae010a6750512 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_join create API.
+ * Test Generated example demonstrating the UFJoin.create API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function uf_join_create_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_join', 'create', $params);
+    $result = civicrm_api3('UFJoin', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -64,11 +64,10 @@ function uf_join_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateUFJoin
-* and can be found in
+* The test that created it is called "testCreateUFJoin"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFJoinTest.php
 *
 * You can see the outcome of the API tests at
index 5de96a06f9b79781dee6aed809b47e83686f0b67..1328f59812e2d15d23ea3c298ab94bb55cdd9b4f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_join get API.
+ * Test Generated example demonstrating the UFJoin.get API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function uf_join_get_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_join', 'get', $params);
+    $result = civicrm_api3('UFJoin', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -59,11 +59,10 @@ function uf_join_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetUFJoinId
-* and can be found in
+* The test that created it is called "testGetUFJoinId"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFJoinTest.php
 *
 * You can see the outcome of the API tests at
index 71cabba8e1d71ce86a5bae9ffc5a77dca6b562c6..de24f6be46c28f60022ffa51fff79fc1a2ac452e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using uf_match get API.
+ * Test Generated example demonstrating the UFMatch.get API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function uf_match_get_example() {
   );
 
   try{
-    $result = civicrm_api3('uf_match', 'get', $params);
+    $result = civicrm_api3('UFMatch', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -54,11 +54,10 @@ function uf_match_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetUFID
-* and can be found in
+* The test that created it is called "testGetUFID"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFMatchTest.php
 *
 * You can see the outcome of the API tests at
index b3bfcd55ddd24754f2f6c0b974176c342c478acc..89a347ffbde261d88a6858f0036470b08806a85b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using website create API.
+ * Test Generated example demonstrating the Website.create API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function website_create_example() {
   );
 
   try{
-    $result = civicrm_api3('website', 'create', $params);
+    $result = civicrm_api3('Website', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -56,11 +56,10 @@ function website_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateWebsite
-* and can be found in
+* The test that created it is called "testCreateWebsite"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
 *
 * You can see the outcome of the API tests at
index 379c1bc707f164a6b4c69ffdc3a4ae90767876ec..fea28bf1645b24c59919101975abad2c7d4eddad 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using website delete API.
+ * Test Generated example demonstrating the Website.delete API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function website_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('website', 'delete', $params);
+    $result = civicrm_api3('Website', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -46,11 +46,10 @@ function website_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeleteWebsite
-* and can be found in
+* The test that created it is called "testDeleteWebsite"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
 *
 * You can see the outcome of the API tests at
index 7f42cf6c2ed2d8b9634027682c56d7860c7a20bd..4b26815ce96b001f01cd97293fc288fa7a1fb2d0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using website get API.
+ * Test Generated example demonstrating the Website.get API.
  *
  * @return array
  *   API result array
@@ -13,7 +13,7 @@ function website_get_example() {
   );
 
   try{
-    $result = civicrm_api3('website', 'get', $params);
+    $result = civicrm_api3('Website', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -56,11 +56,10 @@ function website_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetWebsite
-* and can be found in
+* The test that created it is called "testGetWebsite"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
 *
 * You can see the outcome of the API tests at
index 2cc7c131157f00e65d52674bf5913901b14066de..915c3c238aa6bd89a418c74c2b6cabf1e0a54aa1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using website getfields API.
+ * Test Generated example demonstrating the Website.getfields API.
  *
  * @return array
  *   API result array
@@ -11,7 +11,7 @@ function website_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('website', 'getfields', $params);
+    $result = civicrm_api3('Website', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -89,11 +89,10 @@ function website_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetFields
-* and can be found in
+* The test that created it is called "testGetFields"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
 *
 * You can see the outcome of the API tests at
index bb58466432995f83bdf49039f0ee72fc1c99c842..db2e42874cdfcf55e3aab181c335c2111bedfa18 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using website get API.
+ * Test Generated example demonstrating the Website.get API.
  *
  * Demonostrates returning field metadata
  *
@@ -17,7 +17,7 @@ function website_get_example() {
   );
 
   try{
-    $result = civicrm_api3('website', 'get', $params);
+    $result = civicrm_api3('Website', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -98,11 +98,10 @@ function website_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetMetadata
-* and can be found in
+* The test that created it is called "testGetMetadata"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/WebsiteTest.php
 *
 * You can see the outcome of the API tests at
index 61324b78ebaca4979447d1c153264384df1158ae..6f761fbbeabcf725def9d673b0a749e6718ddd2e 100755 (executable)
@@ -1050,14 +1050,14 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    * @param string $file
    *   Pass this in to create a generated example.
    * @param string $description
-   * @param string|null $subfile
-   * @param string|null $actionName
+   * @param string|null $exampleName
+   *
    * @return array|int
    */
-  public function callAPIAndDocument($entity, $action, $params, $function, $file, $description = "", $subfile = NULL, $actionName = NULL) {
+  public function callAPIAndDocument($entity, $action, $params, $function, $file, $description = "", $exampleName = NULL) {
     $params['version'] = $this->_apiversion;
     $result = $this->callAPISuccess($entity, $action, $params);
-    $this->documentMe($params, $result, $function, $file, $description, $subfile, $actionName);
+    $this->documentMe($entity, $action, $params, $result, $function, $file, $description, $exampleName);
     return $result;
   }
 
@@ -2249,100 +2249,50 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    * define(DONT_DOCUMENT_TEST_CONFIG ,1);
    * in your settings file
    *
+   * @param string $entity
+   * @param string $action
    * @param array $params
    *   Array as passed to civicrm_api function.
    * @param array $result
    *   Array as received from the civicrm_api function.
-   * @param string $function
+   * @param string $testFunction
    *   Calling function - generally __FUNCTION__.
-   * @param string $filename
+   * @param string $testFile
    *   Called from file - generally __FILE__.
    * @param string $description
    *   Descriptive text for the example file.
-   * @param string $subfile
-   *   Name for subfile - if this is completed the example will be put in a subfolder (named by the entity).
-   * @param string $action
-   *   Optional action - otherwise taken from function name.
+   * @param string $exampleName
+   *   Name for this example file (CamelCase) - if ommitted the action name will be substituted.
    */
-  public function documentMe($params, $result, $function, $filename, $description = "", $subfile = NULL, $action = NULL) {
+  private function documentMe($entity, $action, $params, $result, $testFunction, $testFile, $description = "", $exampleName = NULL) {
     if (defined('DONT_DOCUMENT_TEST_CONFIG') && DONT_DOCUMENT_TEST_CONFIG) {
       return;
     }
-    $entity = substr(basename($filename), 0, strlen(basename($filename)) - 8);
-    //todo - this is a bit cludgey
-    if (empty($action)) {
-      if (strstr($function, 'Create')) {
-        $action = empty($action) ? 'create' : $action;
-        $entityAction = 'Create';
-      }
-      elseif (strstr($function, 'GetSingle')) {
-        $action = empty($action) ? 'getsingle' : $action;
-        $entityAction = 'GetSingle';
-      }
-      elseif (strstr($function, 'GetValue')) {
-        $action = empty($action) ? 'getvalue' : $action;
-        $entityAction = 'GetValue';
-      }
-      elseif (strstr($function, 'GetCount')) {
-        $action = empty($action) ? 'getcount' : $action;
-        $entityAction = 'GetCount';
-      }
-      elseif (strstr($function, 'GetFields')) {
-        $action = empty($action) ? 'getfields' : $action;
-        $entityAction = 'GetFields';
-      }
-      elseif (strstr($function, 'GetList')) {
-        $action = empty($action) ? 'getlist' : $action;
-        $entityAction = 'GetList';
-      }
-      elseif (strstr($function, 'GetActions')) {
-        $action = empty($action) ? 'getactions' : $action;
-        $entityAction = 'GetActions';
-      }
-      elseif (strstr($function, 'Get')) {
-        $action = empty($action) ? 'get' : $action;
-        $entityAction = 'Get';
-      }
-      elseif (strstr($function, 'Delete')) {
-        $action = empty($action) ? 'delete' : $action;
-        $entityAction = 'Delete';
-      }
-      elseif (strstr($function, 'Update')) {
-        $action = empty($action) ? 'update' : $action;
-        $entityAction = 'Update';
-      }
-      elseif (strstr($function, 'Subscribe')) {
-        $action = empty($action) ? 'subscribe' : $action;
-        $entityAction = 'Subscribe';
-      }
-      elseif (strstr($function, 'Submit')) {
-        $action = empty($action) ? 'submit' : $action;
-        $entityAction = 'Submit';
-      }
-      elseif (strstr($function, 'Apply')) {
-        $action = empty($action) ? 'apply' : $action;
-        $entityAction = 'Apply';
-      }
-      elseif (strstr($function, 'Replace')) {
-        $action = empty($action) ? 'replace' : $action;
-        $entityAction = 'Replace';
+    $entity = _civicrm_api_get_camel_name($entity);
+    $action = strtolower($action);
+
+    if (empty($exampleName)) {
+      // Attempt to convert lowercase action name to CamelCase.
+      // This is clunky/imperfect due to the convention of all lowercase actions.
+      $exampleName = CRM_Utils_String::convertStringToCamel($action);
+      $knownPrefixes = array(
+        'Get',
+        'Set',
+        'Create',
+        'Update',
+        'Send',
+      );
+      foreach ($knownPrefixes as $prefix) {
+        if (strpos($exampleName, $prefix) === 0 && $prefix != $exampleName) {
+          $exampleName[strlen($prefix)] = strtoupper($exampleName[strlen($prefix)]);
+        }
       }
     }
-    else {
-      $entityAction = ucwords($action);
-    }
 
     $this->tidyExampleResult($result);
     if (isset($params['version'])) {
       unset($params['version']);
     }
-    // a cleverer person than me would do it in a single regex
-    if (strstr($entity, 'UF')) {
-      $fnPrefix = strtolower(preg_replace('/(?<! )(?<!^)(?<=UF)[A-Z]/', '_$0', $entity));
-    }
-    else {
-      $fnPrefix = strtolower(preg_replace('/(?<! )(?<!^)[A-Z]/', '_$0', $entity));
-    }
     // Format multiline description as array
     $desc = array();
     if (is_string($description) && strlen($description)) {
@@ -2351,25 +2301,20 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       }
     }
     $smarty = CRM_Core_Smarty::singleton();
-    $smarty->assign('testfunction', $function);
-    $function = $fnPrefix . "_" . strtolower($action);
-    $smarty->assign('function', $function);
-    $smarty->assign('fnPrefix', $fnPrefix);
+    $smarty->assign('testFunction', $testFunction);
+    $smarty->assign('function', _civicrm_api_get_entity_name_from_camel($entity) . "_$action");
     $smarty->assign('params', $params);
     $smarty->assign('entity', $entity);
-    $smarty->assign('filename', basename($filename));
+    $smarty->assign('testFile', basename($testFile));
     $smarty->assign('description', $desc);
     $smarty->assign('result', $result);
-
     $smarty->assign('action', $action);
-    if (empty($subfile)) {
-      $subfile = $entityAction;
-    }
+
     if (file_exists('../tests/templates/documentFunction.tpl')) {
       if (!is_dir("../api/v3/examples/$entity")) {
         mkdir("../api/v3/examples/$entity");
       }
-      $f = fopen("../api/v3/examples/$entity/$subfile.php", "w+b");
+      $f = fopen("../api/v3/examples/$entity/$exampleName.php", "w+b");
       fwrite($f, $smarty->fetch('../tests/templates/documentFunction.tpl'));
       fclose($f);
     }
index e8aafa0b638ab09f46edaebda51992fe45b6d329..0236aed7c812ca3ad50e6422306b946541754cd7 100644 (file)
@@ -411,11 +411,11 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $params = $this->_params;
     $params['custom_' . $customField['id']] = "$this->_contactID";
 
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Create');
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $result = $this->callAPIAndDocument($this->_entity, 'get', array(
       'return.custom_' . $customField['id'] => 1,
       'id' => $result['id'],
-    ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
+    ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet');
 
     $this->assertEquals('Anderson, Anthony', $result['values'][$result['id']]['custom_' . $customField['id']]);
     $this->assertEquals($this->_contactID, $result['values'][$result['id']]['custom_' . $customField['id'] . "_id"], ' in line ' . __LINE__);
@@ -501,7 +501,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
    */
   public function testActivityGetGoodID1() {
     // Insert rows in civicrm_activity creating activities 4 and 13
-    $description = "Demonstrates getting asignee_contact_id & using it to get the contact.";
+    $description = "Demonstrates getting assignee_contact_id & using it to get the contact.";
     $subfile = 'ReturnAssigneeContact';
     $activity = $this->callAPISuccess('activity', 'create', $this->_params);
 
@@ -794,8 +794,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
       'version' => $this->_apiversion,
     );
 
-    $result = $this->callAPISuccess('activity', 'delete', $params);
-    $this->documentMe($params, $result, __FUNCTION__, __FILE__);
+    $this->callAPIAndDocument('activity', 'delete', $params, __FUNCTION__, __FILE__);
   }
 
   /**
@@ -1176,7 +1175,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
    */
   public function testGetFields() {
     $params = array('action' => 'create');
-    $result = $this->callAPIAndDocument('activity', 'getfields', $params, __FUNCTION__, __FILE__, NULL, NULL, 'getfields');
+    $result = $this->callAPIAndDocument('activity', 'getfields', $params, __FUNCTION__, __FILE__, NULL, NULL);
     $this->assertTrue(is_array($result['values']), 'get fields doesn\'t return values array');
     foreach ($result['values'] as $key => $value) {
       $this->assertTrue(is_array($value), $key . " is not an array");
index 85ed7ff58fc06a773e659dcfd4a5ce263fab59e9..125ba413f186e4d1765e3ddf0ed92daac2591db2 100644 (file)
@@ -101,7 +101,7 @@ class api_v3_ConstantTest extends CiviUnitTestCase {
     $params = array(
       'field' => 'location_type_id',
     );
-    $result = $this->callAPISuccess('address', 'getoptions', $params);
+    $result = $this->callAPIAndDocument('address', 'getoptions', $params, __FUNCTION__, __FILE__);
     $this->assertTrue($result['count'] > 3, "In line " . __LINE__);
     $this->assertContains('Home', $result['values'], "In line " . __LINE__);
     $this->assertContains('Work', $result['values'], "In line " . __LINE__);
@@ -116,7 +116,7 @@ class api_v3_ConstantTest extends CiviUnitTestCase {
     $params = array(
       'field' => 'phone_type_id',
     );
-    $result = $this->callAPISuccess('phone', 'getoptions', $params);
+    $result = $this->callAPIAndDocument('phone', 'getoptions', $params, __FUNCTION__, __FILE__);
 
     $this->assertEquals(5, $result['count'], "In line " . __LINE__);
     $this->assertContains('Phone', $result['values'], "In line " . __LINE__);
@@ -133,7 +133,7 @@ class api_v3_ConstantTest extends CiviUnitTestCase {
     $params = array(
       'field' => 'protocol',
     );
-    $result = $this->callAPISuccess('mail_settings', 'getoptions', $params);
+    $result = $this->callAPIAndDocument('mail_settings', 'getoptions', $params, __FUNCTION__, __FILE__);
 
     $this->assertEquals(4, $result['count'], "In line " . __LINE__);
     $this->assertContains('IMAP', $result['values'], "In line " . __LINE__);
index a8a7f03eb9b13040496ce3394837e6fe6a270ff7..9b606653800ae902ab86f76652c2c47314464b4f 100644 (file)
@@ -1728,7 +1728,7 @@ class api_v3_ContactTest extends CiviUnitTestCase {
       It will be ignored if there is not exactly 1 result";
     $subFile = "FormatSingleValue";
     $params = array('id' => 17, 'return' => 'display_name');
-    $result = $this->callAPIAndDocument('Contact', 'getvalue', $params, __FUNCTION__, __FILE__, $description, $subFile, 'getvalue');
+    $result = $this->callAPIAndDocument('Contact', 'getvalue', $params, __FUNCTION__, __FILE__, $description, $subFile);
     $this->assertEquals('Test Contact', $result);
     $this->callAPISuccess('Contact', 'Delete', $params);
   }
index 92d73a9db7ac5b6ca58b9952196233f0a0e31dd6..6361c6481c87d9d3b4aa0027d96dbac2f32694bd 100644 (file)
@@ -165,7 +165,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
 
     );
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
+    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contribution = $this->callAPISuccess('contribution', 'getsingle', array('contribution_page_id' => $this->_ids['contribution_page']));
     $this->callAPISuccess('membership_payment', 'getsingle', array('contribution_id' => $contribution['id']));
   }
@@ -185,7 +185,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'selectMembership' => $this->_ids['membership_type'],
     );
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
+    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $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());
@@ -211,7 +211,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'selectMembership' => $this->_ids['membership_type'][1],
     );
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
+    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contributions = $this->callAPISuccess('contribution', 'get', array('contribution_page_id' => $this->_ids['contribution_page']));
     $this->assertCount(2, $contributions['values']);
     $ids = array_keys($contributions['values']);
@@ -243,7 +243,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'cvv2' => 123,
     );
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
+    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contributions = $this->callAPISuccess('contribution', 'get', array(
       'contribution_page_id' => $this->_ids['contribution_page'],
       'contribution_status_id' => 1,
@@ -289,7 +289,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'frequency_unit' => 'month',
     );
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
+    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contribution = $this->callAPISuccess('contribution', 'getsingle', array(
       'contribution_page_id' => $this->_ids['contribution_page'],
       'contribution_status_id' => 1,
@@ -351,7 +351,7 @@ class api_v3_ContributionPageTest extends CiviUnitTestCase {
       'frequency_unit' => 'month',
     );
 
-    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL, 'Submit');
+    $this->callAPIAndDocument('contribution_page', 'submit', $submitParams, __FUNCTION__, __FILE__, 'submit contribution page', NULL);
     $contribution = $this->callAPISuccess('contribution', 'getsingle', array(
       'contribution_page_id' => $this->_ids['contribution_page'],
       'contribution_status_id' => 2,
index 96dba20f96248874649fb5a2185a2ca4502e716d..5945234b5c3b16143dbba85a5a0c3da2b53f8db4 100644 (file)
@@ -369,7 +369,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
     );
     $description = "Demonstrates retrieving metadata with custom field options.";
     $subfile = "GetFieldsOptions";
-    $fields = $this->callAPIAndDocument('contact', 'getfields', $getFieldsParams, __FUNCTION__, 'ContactTest.php', $description, $subfile, 'GetFields');
+    $fields = $this->callAPIAndDocument('contact', 'getfields', $getFieldsParams, __FUNCTION__, 'ContactTest.php', $description, $subfile);
     $this->assertArrayHasKey('options', $fields['values']['custom_' . $customField['id']]);
     $this->assertEquals('Label1', $fields['values']['custom_' . $customField['id']]['options'][1]);
     $getOptionsArray = array(
@@ -377,7 +377,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
     );
     $description = "Demonstrates retrieving options for a custom field.";
     $subfile = "GetOptions";
-    $result = $this->callAPIAndDocument('contact', 'getoptions', $getOptionsArray, __FUNCTION__, 'ContactTest.php', $description, '', 'getoptions');
+    $result = $this->callAPIAndDocument('contact', 'getoptions', $getOptionsArray, __FUNCTION__, 'ContactTest.php', $description, '');
     $this->assertEquals('Label1', $result['values'][1]);
   }
 
index 95d0437275e4d9e171215322689cb18ba17d7002..24292deed884b7df84d9b923110c9b89adbfa3e5 100644 (file)
@@ -108,7 +108,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase {
 
     $result = $this->callAPIAndDocument('CustomValue', 'Get', $params, __FUNCTION__, __FILE__, $description);
     $params['format.field_names'] = 1;
-    $resultformatted = $this->callAPIAndDocument('CustomValue', 'Get', $params, __FUNCTION__, __FILE__, "utilises field names", 'formatFieldName');
+    $resultformatted = $this->callAPIAndDocument('CustomValue', 'Get', $params, __FUNCTION__, __FILE__, "utilises field names", 'FormatFieldName');
     // delete the contact
     $this->callAPISuccess('contact', 'delete', array('id' => $contact_id));
     $this->assertEquals('coffee', $result['values'][$secondCustomField]['2']);
index 709691bb29a7a2208149a2f87ff372c0dae5ddc9..c149a72d85835aad9467af43815b5930868eb6a0 100644 (file)
@@ -91,7 +91,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase {
       'tag_id' => $this->_tagID,
     );
 
-    $result = $this->callAPIAndDocument('entity_tag', 'create', $params, __FUNCTION__, __FILE__);
+    $result = $this->callAPISuccess('entity_tag', 'create', $params, __FUNCTION__, __FILE__);
     $this->assertEquals($result['added'], 1);
   }
 
@@ -150,7 +150,7 @@ class api_v3_EntityTagTest extends CiviUnitTestCase {
     $paramsEntity = array(
       'contact_id' => $contactId,
     );
-    $entity = $this->callAPISuccess('entity_tag', 'get', $paramsEntity);
+    $entity = $this->callAPIAndDocument('entity_tag', 'get', $paramsEntity, __FUNCTION__, __FILE__);
   }
 
   public function testHouseholdEntityGet() {
index a6f6d210cf15d6482952a3fd8b070f4ca63a1548..fa478a7b1dfb3b4ad0ab5f583ab3ec2ac6168f12 100644 (file)
@@ -255,7 +255,7 @@ class api_v3_EventTest extends CiviUnitTestCase {
         'contact_id' => $contactID,
         'event_id' => $this->_eventIds[0],
       ));
-    $currentEvent = $this->callAPIAndDocument('Event', 'getsingle', $getEventParams, __FUNCTION__, __FILE__, $description, $subfile, 'getsingle');
+    $currentEvent = $this->callAPIAndDocument('Event', 'getsingle', $getEventParams, __FUNCTION__, __FILE__, $description, $subfile);
     $this->assertEquals(1, $currentEvent['is_full'], ' is full is set in line ' . __LINE__);
     $this->assertEquals(0, $currentEvent['available_places'], 'available places is set in line ' . __LINE__);
 
index 15a5db8ba8f48cace072c770869ab1161394215b..69d86abe8e679aefb9cd91d0e0a9fa43cfd16938 100644 (file)
@@ -142,7 +142,7 @@ class api_v3_GroupTest extends CiviUnitTestCase {
   public function testgetfields() {
     $description = "Demonstrate use of getfields to interrogate api.";
     $params = array('action' => 'create');
-    $result = $this->callAPIAndDocument('group', 'getfields', $params, __FUNCTION__, __FILE__, $description, 'getfields', 'getfields');
+    $result = $this->callAPIAndDocument('group', 'getfields', $params, __FUNCTION__, __FILE__, $description);
     $this->assertEquals(1, $result['values']['is_active']['api.default']);
   }
 
index 793e23ed984745fa1be928db2db5ba09dcd1d33e..b5e7b6b082182bea4ea59ceaba1b89141e42ac25 100644 (file)
@@ -66,7 +66,7 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
       'email_id' => $email['id'],
     );
     $description = 'Create locBlock with existing entities';
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, 'simpleCreate');
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description);
     $id = $result['id'];
     $this->assertEquals(1, $result['count']);
     $this->assertNotNull($result['values'][$id]['id']);
@@ -96,7 +96,7 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
       ),
     );
     $description = "Create entities and locBlock in 1 api call.";
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, 'createEntities');
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, 'CreateEntities');
     $id = $result['id'];
     $this->assertEquals(1, $result['count']);
 
@@ -106,7 +106,7 @@ class api_v3_LocBlockTest extends CiviUnitTestCase {
       'return' => 'all',
     );
     // Can't use callAPISuccess with getsingle.
-    $result = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__, 'Get entities and location block in 1 api call', 'getEntities', 'get');
+    $result = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__, 'Get entities and location block in 1 api call');
     $result = array_pop($result['values']);
     $this->assertNotNull($result['email_id']);
     $this->assertNotNull($result['phone_id']);
index d4152395298fcd86f5c948f0176acb48affc6a5e..ed53da2ec1c16d79bcedd151391c67c6fad07350 100644 (file)
@@ -340,7 +340,6 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
   public function testGetOnlyActive() {
     $description = "Demonstrates use of 'filter' active_only' param.";
     $this->_membershipID = $this->contactMembershipCreate($this->_params);
-    $subfile = 'filterIsCurrent';
     $params = array(
       'contact_id' => $this->_contactID,
       'active_only' => 1,
@@ -356,7 +355,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
       ),
     );
 
-    $membership = $this->callAPIAndDocument('membership', 'get', $params, __FUNCTION__, __FILE__, $description, $subfile);
+    $membership = $this->callAPIAndDocument('membership', 'get', $params, __FUNCTION__, __FILE__, $description, 'FilterIsCurrent');
     $this->assertEquals($membership['values'][$this->_membershipID]['status_id'], $this->_membershipStatusID);
     $this->assertEquals($membership['values'][$this->_membershipID]['contact_id'], $this->_contactID);
 
@@ -675,7 +674,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $params = $this->_params;
     $params['custom_' . $ids['custom_field_id']] = "custom string";
 
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, NULL, 'CreateWithCustomData');
     $check = $this->callAPISuccess($this->_entity, 'get', array(
       'id' => $result['id'],
       'contact_id' => $this->_contactID,
@@ -811,7 +810,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
 
     $params = $this->_params;
     $params['custom_' . $ids['custom_field_id']] = "custom string";
-    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__);
+    $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, NULL, 'UpdateCustomData');
     $result = $this->callAPISuccess($this->_entity, 'create', array(
       'id' => $result['id'],
       'custom_' . $ids['custom_field_id'] => "new custom",
index dd0ac6166ae88576ac222d7d64e438d0c22bd6a1..3e1210ffe66e4e7dd526b7a7884cc2a9c41c574f 100644 (file)
@@ -693,7 +693,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase {
     $participants = $this->callAPISuccess('Participant', 'Get', array());
     $this->assertEquals($participants['count'], 3);
     $params = array('contact_id' => $this->_contactID2, 'api.participant.delete' => 1);
-    $participants = $this->callAPIAndDocument('Participant', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Get');
+    $participants = $this->callAPIAndDocument('Participant', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $check = $this->callAPISuccess('participant', 'getcount', array());
     $this->assertEquals(1, $check, "only one participant should be left. line " . __LINE__);
   }
index f619dfe9a616d75e1ad4fba9cd1b570ea26c5215..385142cc00faa6e847a35d018c933f677ff2b147 100644 (file)
@@ -312,7 +312,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     );
     // we'll check it with a 'get'
     $description = "Shows getting a variable for all domains.";
-    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetAllDomains', 'Get');
+    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetAllDomains');
 
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
     $this->assertEquals(1, $result['values'][1]['uniq_email_per_site']);
@@ -332,7 +332,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
       'return' => array('uniq_email_per_site'),
     );
     $description = "Shows getting a variable for specified domains.";
-    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSpecifiedDomains', 'Get');
+    $result = $this->callAPIAndDocument('setting', 'get', $params, __FUNCTION__, __FILE__, $description, 'GetSpecifiedDomains');
     $this->assertEquals(1, $result['values'][2]['uniq_email_per_site']);
     $this->assertEquals(0, $result['values'][1]['uniq_email_per_site']);
 
@@ -459,7 +459,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     $params = array(
       'name' => 'address_format',
     );
-    $result = $this->callAPIAndDocument('setting', 'getdefaults', $params, __FUNCTION__, __FILE__, $description, 'GetDefaults', 'getdefaults');
+    $result = $this->callAPIAndDocument('setting', 'getdefaults', $params, __FUNCTION__, __FILE__, $description, 'GetDefaults');
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
     $params = array('name' => 'mailing_format');
     $result = $this->callAPISuccess('setting', 'getdefaults', $params);
@@ -484,7 +484,7 @@ class api_v3_SettingTest extends CiviUnitTestCase {
     //make sure it's set
     $this->assertEquals('xyz', $result['values'][CRM_Core_Config::domainID()]['address_format']);
     $description = "Demonstrates reverting a parameter to default value.";
-    $result = $this->callAPIAndDocument('setting', 'revert', $revertParams, __FUNCTION__, __FILE__, $description, '', 'revert');
+    $result = $this->callAPIAndDocument('setting', 'revert', $revertParams, __FUNCTION__, __FILE__, $description, '');
     //make sure it's reverted
     $result = $this->callAPISuccess('setting', 'get', $params);
     $this->assertEquals("{contact.address_name}\n{contact.street_address}\n{contact.supplemental_address_1}\n{contact.supplemental_address_2}\n{contact.city}{, }{contact.state_province}{ }{contact.postal_code}\n{contact.country}", $result['values'][CRM_Core_Config::domainID()]['address_format']);
index 3dd8419dedd97abcee266e4df2a6f2a28302cd20..beba86ad538dcd9b1093496b8c403d605d35752d 100644 (file)
@@ -63,7 +63,7 @@ class api_v3_SystemTest extends CiviUnitTestCase {
     $this->assertEquals('abc', CRM_Core_BAO_Cache::getItem(self::TEST_CACHE_GROUP, self::TEST_CACHE_PATH));
 
     $params = array();
-    $result = $this->callAPIAndDocument('system', 'flush', $params, __FUNCTION__, __FILE__, "Flush all system caches", 'Flush', 'flush');
+    $result = $this->callAPIAndDocument('system', 'flush', $params, __FUNCTION__, __FILE__, "Flush all system caches", 'Flush');
 
     $this->assertTrue(NULL === CRM_Core_BAO_Cache::getItem(self::TEST_CACHE_GROUP, self::TEST_CACHE_PATH));
   }
index 07ab1bdbd1a077cda70b79300226314a0b68b8b7..c1636e61955e52a843fb1498f994288c388e68cc 100644 (file)
@@ -83,7 +83,7 @@ class api_v3_TagTest extends CiviUnitTestCase {
    */
   public function testGetReturnArray() {
     $description = "Demonstrates use of Return as an array.";
-    $subfile = "getReturnArray";
+    $subfile = "GetReturnArray";
 
     $params = array(
       'id' => $this->tagID,
@@ -185,7 +185,7 @@ class api_v3_TagTest extends CiviUnitTestCase {
   public function testTagGetfields() {
     $description = "Demonstrate use of getfields to interrogate api.";
     $params = array('action' => 'create');
-    $result = $this->callAPIAndDocument('tag', 'getfields', $params, __FUNCTION__, __FILE__, $description, NULL, 'getfields');
+    $result = $this->callAPIAndDocument('tag', 'getfields', $params, __FUNCTION__, __FILE__, $description, NULL);
     $this->assertEquals('civicrm_contact', $result['values']['used_for']['api.default']);
   }
 
index 6e1ee0bb061cd391d30f5bb3284f57c0b3a38ea3..43293eeda32672b03f64a421c05c0e8b741834c1 100644 (file)
@@ -1,6 +1,6 @@
 {literal}<?php{/literal}
 /**
- * Test Generated example of using {$fnPrefix} {$action} API.
+ * Test Generated example demonstrating the {$entity}.{$action} API.
  *
 {if !empty($result.deprecated) && is_string($result.deprecated)}
  * @deprecated
@@ -22,7 +22,7 @@ function {$function}_example() {literal}{{/literal}
   $params = {$params|@print_array};
 {literal}
   try{{/literal}
-    $result = civicrm_api3('{$fnPrefix}', '{$action}', $params);
+    $result = civicrm_api3('{$entity}', '{$action}', $params);
 {literal}  }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -52,12 +52,11 @@ function {$function}_expectedresult() {literal}{{/literal}
   return $expectedResult;
 {literal}}{/literal}
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* {$testfunction}
-* and can be found in
-* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/{$filename}
+* The test that created it is called "{$testFunction}"
+* and can be found at:
+* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/{$testFile}
 *
 * You can see the outcome of the API tests at
 * https://test.civicrm.org/job/CiviCRM-master-git/