Update test examples.
[civicrm-core.git] / api / v3 / examples / MessageTemplate / Create.php
index 0cea8626732cd976d471d60502d528cabda14d72..094118233901e9664e5cc2f2249446a30327f012 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Test Generated example of using message_template create API.
+ * Test Generated example demonstrating the MessageTemplate.create API.
  *
  * @return array
  *   API result array
@@ -17,7 +17,7 @@ function message_template_create_example() {
   );
 
   try{
-    $result = civicrm_api3('message_template', 'create', $params);
+    $result = civicrm_api3('MessageTemplate', 'create', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -25,7 +25,8 @@ function message_template_create_example() {
     $errorCode = $e->getErrorCode();
     $errorData = $e->getExtraParams();
     return array(
-      'error' => $errorMessage,
+      'is_error' => 1,
+      'error_message' => $errorMessage,
       'error_code' => $errorCode,
       'error_data' => $errorData,
     );
@@ -67,11 +68,10 @@ function message_template_create_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCreate
-* and can be found in
+* The test that created it is called "testCreate"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MessageTemplateTest.php
 *
 * You can see the outcome of the API tests at