CRM-18134 test to see if priority_id sets to Normal by default & since it does, don...
authoreileen <emcnaughton@wikimedia.org>
Tue, 8 Mar 2016 22:16:59 +0000 (11:16 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 8 Mar 2016 22:17:05 +0000 (11:17 +1300)
CRM/Dedupe/Merger.php
tests/phpunit/api/v3/ActivityTest.php

index 301e7f70591bcec40768eb65320d20054a9eeac2..d2e0b6f72e760b608cfcf5e13956285a05f2e814 100644 (file)
@@ -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;
index cd942a1064e1e1b3d1843b2ef617a155e4b3e68a..27611c362dc9ad9cd8cd3bd5e48867581333182d 100644 (file)
@@ -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']));
   }
 
   /**