Merge pull request #9724 from civicrm/michaelmcandrew-CRM-19921
[civicrm-core.git] / api / v3 / examples / ContributionSoft / Create.php
index 74eb2d1268735ec8817920166d00c791f0ffd916..8450990dfc2409e9301cd7079452d8f08f44465b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using contribution_soft create API.
+ * Test Generated example demonstrating the ContributionSoft.create API.
  *
  * @return array
  *   API result array
@@ -15,7 +15,7 @@ function contribution_soft_create_example() {
   );
 
   try{
-    $result = civicrm_api3('contribution_soft', 'create', $params);
+    $result = civicrm_api3('ContributionSoft', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -23,7 +23,8 @@ function contribution_soft_create_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -64,11 +65,10 @@ function contribution_soft_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreateContributionSoft
-* and can be found in
+* The test that created it is called "testCreateContributionSoft"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContributionSoftTest.php
 *
 * You can see the outcome of the API tests at