Fix primary mobile number test for CRM-21320
authorJKingsnorth <john@johnkingsnorth.co.uk>
Tue, 6 Feb 2018 23:03:07 +0000 (23:03 +0000)
committerJKingsnorth <john@johnkingsnorth.co.uk>
Tue, 6 Feb 2018 23:03:07 +0000 (23:03 +0000)
tests/phpunit/CRM/Mailing/BAO/MailingTest.php

index 998869a99ae039538d810f3c737ebd75517a8682..0fc0bfeb81acd94089cc7254b49b9a8c412da89b 100644 (file)
@@ -34,6 +34,17 @@ class CRM_Mailing_BAO_MailingTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
+  /**
+   * Things to test:
+   * - include static group(s)
+   * - include smart group(s)
+   * - exclude static group(s)
+   * - exclude smart group(s)
+   * - include previous recipients(ss)
+   * - exclude previous recipients(ss)
+   * Repeat for SMS.
+   */
+
   /**
    * Test CRM_Mailing_BAO_Mailing::getRecipients() on sms mode
    */
@@ -87,20 +98,21 @@ class CRM_Mailing_BAO_MailingTest extends CiviUnitTestCase {
           'is_primary' => 0,
         ))),
       ),
+      // Create the non-primary with a lower ID than the primary, to test CRM-21320
       $contactID2 => array(
-        'primary_phone_id' => CRM_Utils_Array::value('id', $this->callAPISuccess('Phone', 'create', array(
+        'other_phone_id' => CRM_Utils_Array::value('id', $this->callAPISuccess('Phone', 'create', array(
           'contact_id' => $contactID2,
           'phone' => "02 01",
           'location_type_id' => "Home",
           'phone_type_id' => "Mobile",
-          'is_primary' => 1,
+          'is_primary' => 0,
         ))),
-        'other_phone_id' => CRM_Utils_Array::value('id', $this->callAPISuccess('Phone', 'create', array(
+        'primary_phone_id' => CRM_Utils_Array::value('id', $this->callAPISuccess('Phone', 'create', array(
           'contact_id' => $contactID2,
           'phone' => "02 02",
           'location_type_id' => "Work",
           'phone_type_id' => "Mobile",
-          'is_primary' => 0,
+          'is_primary' => 1,
         ))),
       ),
     );