3 * Test Generated example of using participant_status_type create API
6 function participant_status_type_create_example(){
8 'name' => 'test status',
9 'label' => 'I am a test',
10 'class' => 'Positive',
19 $result = civicrm_api3('participant_status_type', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
26 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
33 * Function returns array of result expected from previous function
35 function participant_status_type_create_expectedresult(){
37 $expectedResult = array(
45 'name' => 'test status',
46 'label' => 'I am a test',
47 'class' => 'Positive',
52 'visibility_id' => '1',
57 return $expectedResult;
62 * This example has been generated from the API test suite. The test that created it is called
64 * testCreateParticipantStatusType and can be found in
65 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantStatusTypeTest.php
67 * You can see the outcome of the API tests at
68 * https://test.civicrm.org/job/CiviCRM-master-git/
70 * To Learn about the API read
71 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
73 * Browse the api on your own site with the api explorer
74 * http://MYSITE.ORG/path/to/civicrm/api/explorer
76 * Read more about testing here
77 * http://wiki.civicrm.org/confluence/display/CRM/Testing
79 * API Standards documentation:
80 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards