From 4b047375cf185613b1ccd8a768eaf1fa646a82de Mon Sep 17 00:00:00 2001 From: Camilo Rodriguez Date: Wed, 9 Aug 2017 17:28:54 +0000 Subject: [PATCH] CRM-20858: Fix Failing Test on Custom Field Merge Test for merging custom fields with is_view flag on was failing. This was happening because the same field was being used on prior tests, setting the is_view flag at the start of the failing test. Fixed by creating a new custom field with the is_view flag set as 1, and using that field on the test. --- tests/phpunit/api/v3/JobTestCustomDataTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 tests/phpunit/api/v3/JobTestCustomDataTest.php diff --git a/tests/phpunit/api/v3/JobTestCustomDataTest.php b/tests/phpunit/api/v3/JobTestCustomDataTest.php old mode 100644 new mode 100755 index 2f656fd5d2..54f6523d2a --- a/tests/phpunit/api/v3/JobTestCustomDataTest.php +++ b/tests/phpunit/api/v3/JobTestCustomDataTest.php @@ -240,7 +240,8 @@ class api_v3_JobTestCustomDataTest extends CiviUnitTestCase { */ public function testBatchMergeDateCustomFieldHandlingIsView() { $this->customFieldCreate(array( - 'id' => $this->customFieldID, + 'label' => 'OnlyView', + 'custom_group_id' => $this->customGroupID, 'is_view' => 1, )); $customFieldLabel = 'custom_' . $this->customFieldID; @@ -249,7 +250,7 @@ class api_v3_JobTestCustomDataTest extends CiviUnitTestCase { $result = $this->callAPISuccess('Job', 'process_batch_merge', array()); $this->assertEquals(1, count($result['values']['merged'])); $contact = $this->callAPISuccess('Contact', 'getsingle', array('id' => $contactID, 'return' => $customFieldLabel)); - $this->assertEquals('2012-11-03', $contact[$customFieldLabel]); + $this->assertEquals('2012-11-03 00:00:00', $contact[$customFieldLabel]); } /** -- 2.25.1