From 1deccd7e4c8e472ded4b0069b07ca43cc124064d Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 11 Jan 2016 21:35:16 -0500 Subject: [PATCH] CRM-17795 Fix testCreateSingleValueAlter --- tests/phpunit/api/v3/SyntaxConformanceTest.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 1ecb250d8c..0b40d45263 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -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'], -- 2.25.1