Merge pull request #9769 from scardinius/crm-19958
[civicrm-core.git] / api / v3 / examples / Survey / ChainedGetDelete.php
index eecfd4a1bb57224282f0a7d693cb9141c5251cf7..860366008bd5dee54826408773d33e276ccd91c4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using survey get API.
+ * Test Generated example demonstrating the Survey.get API.
  *
  * Demonstrates get + delete in the same call.
  *
@@ -14,7 +14,7 @@ function survey_get_example() {
   );
 
   try{
-    $result = civicrm_api3('survey', 'get', $params);
+    $result = civicrm_api3('Survey', 'get', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -22,7 +22,8 @@ function survey_get_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -60,7 +61,7 @@ function survey_get_expectedresult() {
           'is_error' => 0,
           'version' => 3,
           'count' => 1,
-          'values' => TRUE,
+          'values' => 1,
         ),
       ),
     ),
@@ -69,11 +70,10 @@ function survey_get_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testGetSurveyChainDelete
-* and can be found in
+* The test that created it is called "testGetSurveyChainDelete"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyTest.php
 *
 * You can see the outcome of the API tests at