Merge pull request #9773 from monishdeb/CRM-19663
[civicrm-core.git] / api / v3 / examples / ActivityType / Get.php
index f914ae5b94ed8f1118ac530142e14d5d7a85bd4c..3befa05035d7e485d1fc4e5bb1c4229caf9c3886 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.
@@ -20,7 +20,8 @@ function activity_type_get_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -40,7 +41,7 @@ function activity_type_get_expectedresult() {
   $expectedResult = array(
     'is_error' => 0,
     'version' => 3,
-    'count' => 50,
+    'count' => 54,
     'values' => array(
       '1' => 'Meeting',
       '2' => 'Phone Call',
@@ -63,7 +64,7 @@ function activity_type_get_expectedresult() {
       '19' => 'Bulk Email',
       '20' => 'Assign Case Role',
       '21' => 'Remove Case Role',
-      '22' => 'Print PDF Letter',
+      '22' => 'Print/Merge Document',
       '23' => 'Merge Case',
       '24' => 'Reassigned Case',
       '25' => 'Link Cases',
@@ -92,18 +93,21 @@ function activity_type_get_expectedresult() {
       '48' => 'Change Registration',
       '49' => 'Downloaded Invoice',
       '50' => 'Emailed Invoice',
+      '51' => 'Contact Merged',
+      '52' => 'Contact Deleted by Merge',
+      '53' => 'Failed Payment',
+      '54' => 'Close Accounting Period',
     ),
-    'deprecated' => 'The 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