X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2Fexamples%2FParticipantPayment%2FCreate.php;h=afb8dc3e8477381d16a0990ca65e9053be7dabd1;hb=3ef52921a7d903e7d032b27bd0fd01ba01f557a3;hp=5dca9fe9f3263a1000c3fcbc9deb1b77693dc07e;hpb=8700de06eaf05c289b9905f308399e81a2a81ecf;p=civicrm-core.git diff --git a/api/v3/examples/ParticipantPayment/Create.php b/api/v3/examples/ParticipantPayment/Create.php index 5dca9fe9f3..afb8dc3e84 100644 --- a/api/v3/examples/ParticipantPayment/Create.php +++ b/api/v3/examples/ParticipantPayment/Create.php @@ -6,10 +6,10 @@ * API result array */ function participant_payment_create_example() { - $params = array( + $params = [ 'participant_id' => 13, 'contribution_id' => 1, - ); + ]; try{ $result = civicrm_api3('ParticipantPayment', 'create', $params); @@ -19,12 +19,12 @@ function participant_payment_create_example() { $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode(); $errorData = $e->getExtraParams(); - return array( + return [ 'is_error' => 1, 'error_message' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData, - ); + ]; } return $result; @@ -38,19 +38,19 @@ function participant_payment_create_example() { */ function participant_payment_create_expectedresult() { - $expectedResult = array( + $expectedResult = [ 'is_error' => 0, 'version' => 3, 'count' => 1, 'id' => 1, - 'values' => array( - '1' => array( + 'values' => [ + '1' => [ 'id' => '1', 'participant_id' => '13', 'contribution_id' => '1', - ), - ), - ); + ], + ], + ]; return $expectedResult; } @@ -62,17 +62,17 @@ function participant_payment_create_expectedresult() { * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantPaymentTest.php * * You can see the outcome of the API tests at -* https://test.civicrm.org/job/CiviCRM-master-git/ +* https://test.civicrm.org/job/CiviCRM-Core-Matrix/ * * To Learn about the API read -* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* https://docs.civicrm.org/dev/en/latest/api/ * -* Browse the api on your own site with the api explorer -* http://MYSITE.ORG/path/to/civicrm/api +* Browse the API on your own site with the API Explorer. It is in the main +* CiviCRM menu, under: Support > Development > API Explorer. * * Read more about testing here -* http://wiki.civicrm.org/confluence/display/CRM/Testing +* https://docs.civicrm.org/dev/en/latest/testing/ * * API Standards documentation: -* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +* https://docs.civicrm.org/dev/en/latest/framework/api-architecture/ */