I see that SimpleTest has a few built in mail functions to check for send success etc, but how can I send a message, assert its content and then click a link within that content during a test?

What is the standard or most common way to test unsubscribe, or account verification links in emails with SimpleTest?


Simpletest automatically captures sent mails during a test and allows you to fetch them using $this->drupalGetMails() in the test class.

I did something like this recently in tests I wrote for the Simplenews project, to test subscription confirmation here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.