CRM-17795 Fix testCreateSingleValueAlter
authorColeman Watts <coleman@civicrm.org>
Tue, 12 Jan 2016 02:35:16 +0000 (21:35 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 12 Jan 2016 02:38:59 +0000 (21:38 -0500)
tests/phpunit/api/v3/SyntaxConformanceTest.php

index 1ecb250d8cd6bede1640545cd5d6bbb8e223b6f2..0b40d45263fb91f8660023785714191750ca3ab6 100644 (file)
@@ -1172,9 +1172,6 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     foreach ($fields as $field => $specs) {
       $resetFKTo = NULL;
       $fieldName = $field;
-      if (!empty($specs['uniquename'])) {
-        $fieldName = $specs['uniquename'];
-      }
       if ($field == 'currency' || $field == 'id' || $field == strtolower($entityName) . '_id'
         || in_array($field, $entityValuesThatDoNotWork)
       ) {
@@ -1234,11 +1231,10 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
               $entity[$fieldName] = (string) $entity2['id'];
             }
             else {
-              $uniqueName = CRM_Utils_Array::value('uniqueName', $specs, $fieldName);
               if (!empty($entity[$fieldName])) {
-                $resetFKTo = array($fieldName => $entity[$fieldName], $uniqueName => $entity[$fieldName]);
+                $resetFKTo = array($fieldName => $entity[$fieldName]);
               }
-              $entity[$fieldName] = (string) empty($entity2[$field]) ? CRM_Utils_Array::value($uniqueName, $entity2) : $entity2[$field];
+              $entity[$fieldName] = (string) empty($entity2[$field]) ? '' : $entity2[$field];
               //todo - there isn't always something set here - & our checking on unset values is limited
               if (empty($entity[$field])) {
                 unset($entity[$field]);
@@ -1295,10 +1291,6 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
         $entity['contribution_type_id'] = $updateParams['financial_type_id'];
       }
 
-      if (!empty($specs['uniqueName'])) {
-        $entity[$specs['uniqueName']] = $entity[$specs['name']];
-      }
-
       $update = $this->callAPISuccess($entityName, 'create', $updateParams);
       $checkParams = array(
         'id' => $entity['id'],