Merge remote-tracking branch 'origin/4.5' into 4.5-master-2015-02-24-17-24-05
[civicrm-core.git] / api / v3 / examples / Contact / GetFieldsOptions.php
index 92731d9f0503c510a2de35433e799f7f72c94df6..d45717fe3711f9fbcfb90576138a6b77c2df4229 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * Test Generated example of using contact GetFields API.
+ * Test Generated example demonstrating the Contact.getfields API.
  *
- * Demonstrate retrieving metadata with custom field options
+ * Demonstrates retrieving metadata with custom field options.
  *
  * @return array
  *   API result array
@@ -16,7 +16,7 @@ function contact_getfields_example() {
   );
 
   try{
-    $result = civicrm_api3('contact', 'GetFields', $params);
+    $result = civicrm_api3('Contact', 'getfields', $params);
   }
   catch (CiviCRM_API3_Exception $e) {
     // Handle error here.
@@ -194,7 +194,7 @@ function contact_getfields_expectedresult() {
         'name' => 'external_identifier',
         'type' => 2,
         'title' => 'External Identifier',
-        'maxlength' => 32,
+        'maxlength' => 64,
         'size' => 8,
         'import' => TRUE,
         'where' => 'civicrm_contact.external_identifier',
@@ -741,7 +741,7 @@ function contact_getfields_expectedresult() {
         'extends_entity_column_id' => '',
         'is_view' => 0,
         'is_multiple' => 0,
-        'option_group_id' => '105',
+        'option_group_id' => '106',
         'date_format' => '',
         'time_format' => '',
         'is_required' => '1',
@@ -757,10 +757,12 @@ function contact_getfields_expectedresult() {
         'title' => 'Current Employer',
         'description' => 'Name of Current Employer',
         'type' => 2,
+        'name' => 'current_employer',
       ),
       'dupe_check' => array(
         'title' => 'Check for Duplicates',
         'description' => 'Throw error if contact create matches dedupe rule',
+        'name' => 'dupe_check',
       ),
     ),
   );
@@ -768,11 +770,10 @@ function contact_getfields_expectedresult() {
   return $expectedResult;
 }
 
-/**
+/*
 * This example has been generated from the API test suite.
-* The test that created it is called
-* testCustomFieldCreateWithOptionValues
-* and can be found in
+* The test that created it is called "testCustomFieldCreateWithOptionValues"
+* and can be found at:
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
 *
 * You can see the outcome of the API tests at