CRM-16705 - Fix syntaxConformanceTest to work with oddball pseudoconstant keyColumn
authorColeman Watts <coleman@civicrm.org>
Wed, 5 Aug 2015 01:42:25 +0000 (21:42 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 5 Aug 2015 01:42:25 +0000 (21:42 -0400)
tests/phpunit/api/v3/SyntaxConformanceTest.php

index 2987a957f60d2664eb21e4d53af7ea57afc1b92e..8769a482c7e9da74e215629d21e36b7c39d75f5c 100644 (file)
@@ -1222,7 +1222,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
                 'sequential' => 1,
               ));
             $optionValue = $optionValue['values'];
-            $options[$optionValue[0]['value']] = 'new option value';
+            $keyColumn = CRM_Utils_Array::value('keyColumn', $specs['pseudoconstant'], 'value');
+            $options[$optionValue[0][$keyColumn]] = 'new option value';
           }
         }
         $entity[$field] = array_rand($options);