From: Eileen McNaughton Date: Sun, 27 Apr 2014 22:42:26 +0000 (-0700) Subject: test fixes for api singleValueAlter - generic fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=edd31a2448cdb88f0934210b127d4fade6121190;p=civicrm-core.git test fixes for api singleValueAlter - generic fixes --- diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index b676e44173..61519a5a1d 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -846,7 +846,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { case CRM_Utils_Type::T_FLOAT: case CRM_Utils_Type::T_MONEY: - $entity[$field] = '22'; + $entity[$field] = '22.75'; break; case CRM_Utils_Type::T_URL: @@ -855,6 +855,12 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { if (!empty($specs['pseudoconstant'])) { $options = $this->callAPISuccess($entityName, 'getoptions', array('context' => 'create', 'field' => $field)); if (empty($options['values'])) { + //eg. pdf_format id doesn't ship with any + if(isset($specs['pseudoconstant']['optionGroupName'])) { + $optionGroupID = $this->callAPISuccess('option_group', 'getvalue', array('name' => 'pdf_format', 'return' => 'id')); + $optionValue = $this->callAPISuccess('option_value', 'create', array('option_group_id' => $optionGroupID, 'label' => 'new option value')); + $options['values'][] = $optionValue['id']; + } } $entity[$field] = array_rand($options['values']); }