APIv3 - getFields - Add unit-test for 'get_options=all'
authorTim Otten <totten@civicrm.org>
Thu, 11 Jul 2013 04:35:51 +0000 (21:35 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 11 Jul 2013 04:35:51 +0000 (21:35 -0700)
tests/phpunit/api/v3/UtilsTest.php

index e00b2fd3c8e2a4c70fcfb542853651da9359cb3c..787ff6e1fb05d819e61bbed5d82071fc0ba39bb7 100644 (file)
@@ -254,5 +254,17 @@ class api_v3_UtilsTest extends CiviUnitTestCase {
     $result = civicrm_api('event', 'getfields', array('version' => 3));
     $this->assertArrayHasKey('values', $result);
   }
+
+  function testGetFields_AllOptions() {
+    $result = civicrm_api('contact', 'getfields', array(
+      'options' => array(
+        'get_options' => 'all',
+      ),
+      'version' => 3
+    ));
+    $this->assertAPISuccess($result);
+    $this->assertEquals('Household', $result['values']['contact_type']['options']['Household']);
+    $this->assertEquals('HTML', $result['values']['preferred_mail_format']['options']['HTML']);
+  }
 }