From: Martin Date: Thu, 3 Jan 2019 19:50:31 +0000 (+0000) Subject: Making mailing test email non-case-sensitive X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=291dfe43de14049be42c5c2b26cfd893f54f46e1;p=civicrm-core.git Making mailing test email non-case-sensitive https://lab.civicrm.org/dev/mail/issues/32 --- diff --git a/api/v3/Mailing.php b/api/v3/Mailing.php index cee37851cd..73eabba477 100644 --- a/api/v3/Mailing.php +++ b/api/v3/Mailing.php @@ -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')) diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index 8214dfaf00..18032ef7fe 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -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