<?php
/**
- * Test Generated example of using activity_type get API.
+ * Test Generated example demonstrating the ActivityType.get API.
*
+ * @deprecated
+ * The ActivityType api is deprecated. Please use the OptionValue api instead.
*
* @return array
* API result array
$params = array();
try{
- $result = civicrm_api3('activity_type', 'get', $params);
+ $result = civicrm_api3('ActivityType', 'get', $params);
}
catch (CiviCRM_API3_Exception $e) {
// Handle error here.
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
return array(
- 'error' => $errorMessage,
+ 'is_error' => 1,
+ 'error_message' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
);
$expectedResult = array(
'is_error' => 0,
'version' => 3,
- 'count' => 50,
+ 'count' => 54,
'values' => array(
'1' => 'Meeting',
'2' => 'Phone Call',
'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',
'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