<?php
-/**
- * @file
- * Test Generated API Example.
- * See bottom of this file for more detail.
- */
-
/**
* Test Generated example of using tax_contribution_page create API.
*
- *
* @return array
* API result array
*/
function tax_contribution_page_create_example() {
- $params = array(
+ $params = [
'contact_id' => 1,
'receive_date' => '20120511',
'total_amount' => '100',
'invoice_id' => 67890,
'source' => 'SSF',
'contribution_status_id' => 2,
- );
+ ];
try{
$result = civicrm_api3('tax_contribution_page', 'create', $params);
$errorMessage = $e->getMessage();
$errorCode = $e->getErrorCode();
$errorData = $e->getExtraParams();
- return array(
+ return [
'error' => $errorMessage,
'error_code' => $errorCode,
'error_data' => $errorData,
- );
+ ];
}
return $result;
*/
function tax_contribution_page_create_expectedresult() {
- $expectedResult = array(
+ $expectedResult = [
'is_error' => 0,
'version' => 3,
'count' => 1,
'id' => 1,
- 'values' => array(
- '1' => array(
+ 'values' => [
+ '1' => [
'id' => '1',
'contact_id' => '1',
'financial_type_id' => '11',
'creditnote_id' => '',
'tax_amount' => '20',
'contribution_type_id' => '11',
- ),
- ),
- );
+ ],
+ ],
+ ];
return $expectedResult;
}
* 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/explorer
+* http://MYSITE.ORG/path/to/civicrm/api
*
* Read more about testing here
* http://wiki.civicrm.org/confluence/display/CRM/Testing