From aa7e7ff0975e90a7de120181d9e9051ff62b5a84 Mon Sep 17 00:00:00 2001
From: Coleman Watts <coleman@civicrm.org>
Date: Mon, 10 Jun 2013 16:42:43 -0700
Subject: [PATCH] Fix custom group test

---
 api/v3/Generic.php                       | 2 +-
 tests/phpunit/api/v3/CustomGroupTest.php | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/api/v3/Generic.php b/api/v3/Generic.php
index 233a8e7765..77713a3e42 100644
--- a/api/v3/Generic.php
+++ b/api/v3/Generic.php
@@ -233,7 +233,7 @@ function civicrm_api3_generic_getoptions($apiRequest) {
  * @param array $fieldsToResolve anny field resolutions specifically requested
  */
 function _civicrm_api3_generic_get_metadata_options(&$metadata, $entity, $fieldname, $fieldSpec, $fieldsToResolve){
-  if(empty($fieldSpec['pseudoconstant'])) {
+  if(empty($fieldSpec['pseudoconstant']) && empty($fieldSpec['enumValues'])) {
     return;
   }
 
diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php
index 6871cd6720..648f003926 100644
--- a/tests/phpunit/api/v3/CustomGroupTest.php
+++ b/tests/phpunit/api/v3/CustomGroupTest.php
@@ -180,23 +180,22 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase {
     $this->assertNotNull($result['id'], 'In line ' . __LINE__);
     $this->assertEquals($result['values'][$result['id']]['extends'], 'Individual', 'In line ' . __LINE__);
   }
+
   /**
    * check with valid array
    */
   function testCustomGroupGetFields() {
     $params = array(
-        'version' => $this->_apiversion,
+      'version' => $this->_apiversion,
+      'options' => array('get_options' => 'style'),
     );
 
     $result = civicrm_api('custom_group', 'getfields', $params);
     $this->assertAPISuccess($result);
-    $this->assertArrayKeyExists('options', $result['values'], ' check that options are rendered for fieldtype enum');
     $this->assertEquals('Tab', $result['values']['style']['options'][0]);
     $this->assertEquals('Inline', $result['values']['style']['options'][1]);
-
   }
 
-
   /**
    * check with extends array length greater than 1
    */
-- 
GitLab