I am working on this ticket now.
I have written two test cases and have issues with the 2nd one
Details:
To test case tokens replacement - here I have created a test 'contact' and a 'case', add a html string with case tokens, use CRM_Utils_Token::replaceCaseTokens to verify if the tokens are replaced properly.
To test sending email with case tokens in body. Here I have created a test 'case' and used CRM_Activity_BAO_Activity::sendEmail (with $caseId parameter passed) and got the activity id returned from sendEmail. I am expecting to see the caseId being associated with the activity but its not there (I am using an api to get activity with ['return' => 'case_id'])
I am not completely sure if this is how this PR needs to be tested. Can someone pls help with this?