Merge pull request #9662 from JMAConsulting/CRM-19792
[civicrm-core.git] / api / v3 / examples / GroupContact / Delete.php
index 8fe66c2d5924017104845803940ea6d13ea7f485..f0118e15e9d185eadf7c82d675938fa1c70643f1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using group_contact delete API.
+ * Test Generated example demonstrating the GroupContact.delete API.
  *
  * @return array
  *   API result array
@@ -12,7 +12,7 @@ function group_contact_delete_example() {
   );
 
   try{
-    $result = civicrm_api3('group_contact', 'delete', $params);
+    $result = civicrm_api3('GroupContact', 'delete', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -20,7 +20,8 @@ function group_contact_delete_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -50,11 +51,10 @@ function group_contact_delete_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testDeletePermanent
-* and can be found in
+* The test that created it is called "testDeletePermanent"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/GroupContactTest.php
 *
 * You can see the outcome of the API tests at