diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index dc360ecaa52e..036d4335f482 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -1255,10 +1255,11 @@ public function testSendEmailBasic(): void { ]; $subject = __FUNCTION__ . ' subject'; - $html = __FUNCTION__ . ' html'; - $text = __FUNCTION__ . ' text'; + $html = __FUNCTION__ . ' html {contact.display_name}'; + $text = __FUNCTION__ . ' text {contact.display_name}'; $userID = $loggedInUser; + $mut = new CiviMailUtils($this, TRUE); [$sent, $activity_ids] = CRM_Activity_BAO_Activity::sendEmail( $contactDetails, $subject, @@ -1266,18 +1267,26 @@ public function testSendEmailBasic(): void { $html, $contact['email'], $userID, - $from = __FUNCTION__ . '@example.com' + $from = __FUNCTION__ . '@example.com', + NULL, + NULL, + NULL, + [$contactId] ); $activity = $this->callAPISuccessGetSingle('Activity', ['id' => $activity_ids[0], 'return' => ['details', 'subject']]); - $details = "-ALTERNATIVE ITEM 0- -$html + $details = '-ALTERNATIVE ITEM 0- +' . __FUNCTION__ . ' html ' . $contact['display_name'] . ' -ALTERNATIVE ITEM 1- -$text +' . __FUNCTION__ . ' text ' . $contact['display_name'] . ' -ALTERNATIVE END- -"; - $this->assertEquals($activity['details'], $details, 'Activity details does not match.'); - $this->assertEquals($activity['subject'], $subject, 'Activity subject does not match.'); +'; + $this->assertEquals($details, $activity['details'], 'Activity details does not match.'); + $this->assertEquals($subject, $activity['subject'], 'Activity subject does not match.'); + $mut->checkMailLog([ + 'Mr. Anthony Anderson', + ]); + $mut->stop(); } public function testSendEmailWithCampaign() {