From f20dc314922a452dae3182e298617f04f815aae6 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 9 Mar 2016 11:16:59 +1300 Subject: [PATCH] CRM-18134 test to see if priority_id sets to Normal by default & since it does, don't pass it in --- CRM/Dedupe/Merger.php | 1 - tests/phpunit/api/v3/ActivityTest.php | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 301e7f7059..d2e0b6f72e 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1845,7 +1845,6 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m 'target_contact_id' => $mainId, 'activity_type_id' => 'Contact Merged', 'status_id' => 'Completed', - 'priority_id' => 'Normal', )); return TRUE; diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index cd942a1064..27611c362d 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -312,18 +312,20 @@ class api_v3_ActivityTest extends CiviUnitTestCase { 'details' => 'a test activity', 'status_id' => 1, 'activity_type_id' => 29, - 'priority_id' => 1, ); $result = $this->callAPISuccess('activity', 'create', $params); - $result = $this->callAPISuccess('activity', 'get', array('id' => $result['id'])); - $this->assertEquals($result['values'][$result['id']]['duration'], 120); - $this->assertEquals($result['values'][$result['id']]['subject'], 'Make-it-Happen Meeting'); - $this->assertEquals($result['values'][$result['id']]['activity_date_time'], '2011-03-16 00:00:00'); - $this->assertEquals($result['values'][$result['id']]['location'], 'Pennsylvania'); - $this->assertEquals($result['values'][$result['id']]['details'], 'a test activity'); - $this->assertEquals($result['values'][$result['id']]['status_id'], 1); + $result = $this->callAPISuccess('activity', 'getsingle', array('id' => $result['id'])); + $this->assertEquals($result['duration'], 120); + $this->assertEquals($result['subject'], 'Make-it-Happen Meeting'); + $this->assertEquals($result['activity_date_time'], '2011-03-16 00:00:00'); + $this->assertEquals($result['location'], 'Pennsylvania'); + $this->assertEquals($result['details'], 'a test activity'); + $this->assertEquals($result['status_id'], 1); + + $priorities = $this->callAPISuccess('activity', 'getoptions', array('field' => 'priority_id')); + $this->assertEquals($result['priority_id'], array_search('Normal', $priorities['values'])); } /** -- 2.25.1