From b4bb913e18bc4cfe27b48446072e3d77b0277ace Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 12 Jun 2013 21:32:47 -0700 Subject: [PATCH] Fix api_v3_UFFieldTest --- api/v3/utils.php | 2 +- tests/phpunit/api/v3/UFFieldTest.php | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/api/v3/utils.php b/api/v3/utils.php index cdf303e0e5..65324f3a7b 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1566,7 +1566,7 @@ function _civicrm_api3_api_match_pseudoconstant(&$params, $entity, $fieldName, $ */ function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldName) { // If option is a key, no need to translate - if (isset($options[$value])) { + if (array_key_exists($value, $options)) { return; } diff --git a/tests/phpunit/api/v3/UFFieldTest.php b/tests/phpunit/api/v3/UFFieldTest.php index 4d678873b5..df6e99bd84 100644 --- a/tests/phpunit/api/v3/UFFieldTest.php +++ b/tests/phpunit/api/v3/UFFieldTest.php @@ -66,6 +66,8 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { ); $this->_sethtmlGlobals(); + civicrm_api('uf_field', 'getfields', array('version' => 3, 'cache_clear' => 1)); + $this->_params = array( 'field_name' => 'phone', 'field_type' => 'Contact', @@ -116,12 +118,6 @@ class api_v3_UFFieldTest extends CiviUnitTestCase { $this->assertAPIFailure($result); } - function testCreateUFFieldWithEmptyParams() { - $params = array(); - $result = civicrm_api('uf_field', 'create', $params); - $this->assertAPIFailure($result); - } - function testCreateUFFieldWithWrongParams() { $result = civicrm_api('uf_field', 'create', array('field_name' => 'test field')); $this->assertAPIFailure($result); -- 2.25.1