From 251a88497b6bcee6d813a0c4e77937bc3f04b21c Mon Sep 17 00:00:00 2001 From: JKingsnorth Date: Tue, 6 Feb 2018 23:03:07 +0000 Subject: [PATCH] Fix primary mobile number test for CRM-21320 --- tests/phpunit/CRM/Mailing/BAO/MailingTest.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php index 998869a99a..0fc0bfeb81 100644 --- a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php @@ -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, ))), ), ); -- 2.25.1