Update Test generated examples
[civicrm-core.git] / api / v3 / examples / Profile / Apply.php
index 0d1359c66370283f9ddf13689a3e5034a7a58c12..57b867c4d3334dd4f238178107e1de1512d08c1d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using profile apply API.
+ * Test Generated example demonstrating the Profile.apply API.
  *
  * @return array
  *   API result array
@@ -18,7 +18,7 @@ function profile_apply_example() {
   );
 
   try{
-    $result = civicrm_api3('profile', 'apply', $params);
+    $result = civicrm_api3('Profile', 'apply', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -26,7 +26,8 @@ function profile_apply_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -85,11 +86,10 @@ function profile_apply_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testProfileApply
-* and can be found in
+* The test that created it is called "testProfileApply"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
 *
 * You can see the outcome of the API tests at