Making mailing test email non-case-sensitive
authorMartin <martinh@peaceworks.ca>
Thu, 3 Jan 2019 19:50:31 +0000 (19:50 +0000)
committerMartin <martinh@peaceworks.ca>
Thu, 3 Jan 2019 19:50:31 +0000 (19:50 +0000)
https://lab.civicrm.org/dev/mail/issues/32

api/v3/Mailing.php
tests/phpunit/api/v3/MailingTest.php

index cee37851cd6b1bd4b09407948a77627f43e2166d..73eabba4774ebd72a3e378ec48bdf98637de6833 100644 (file)
@@ -632,7 +632,7 @@ function civicrm_api3_mailing_send_test($params) {
   $testEmailParams['scheduled_date'] = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s'));
   $job = civicrm_api3('MailingJob', 'create', $testEmailParams);
   $testEmailParams['job_id'] = $job['id'];
-  $testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', $testEmailParams['test_email']) : NULL;
+  $testEmailParams['emails'] = array_key_exists('test_email', $testEmailParams) ? explode(',', strtolower($testEmailParams['test_email'])) : NULL;
   if (!empty($params['test_email'])) {
     $query = CRM_Utils_SQL_Select::from('civicrm_email e')
         ->select(array('e.id', 'e.contact_id', 'e.email'))
index 8214dfaf00fb55c7086afca4943cdf261e91e918..18032ef7fe5b228267e06cf627778c91f5d02285 100644 (file)
@@ -409,8 +409,9 @@ class api_v3_MailingTest extends CiviUnitTestCase {
 
     $mail = $this->callAPISuccess('mailing', 'create', $this->_params);
 
-    $params = array('mailing_id' => $mail['id'], 'test_email' => 'alice@example.org', 'test_group' => NULL);
+    $params = array('mailing_id' => $mail['id'], 'test_email' => 'ALicE@example.org', 'test_group' => NULL);
     // Per https://lab.civicrm.org/dev/core/issues/229 ensure this is not passed through!
+    // Per https://lab.civicrm.org/dev/mail/issues/32 test non-lowercase email
     $params['id'] = $mail['id'];
     $deliveredInfo = $this->callAPISuccess($this->_entity, 'send_test', $params);
     $this->assertEquals(1, $deliveredInfo['count']); // verify mail has been sent to user by count