Currently assertMail() only returns TRUE if the given $value is identical with the field ('body', 'id' ...) of the e-mail. This makes it hard to write tests for the content of larger e-mails which often contain dynamic text.

Additional helper functions have to be written inside the tests that capture the entire e-mail into a new variable to then parse it.

This might also explain the lack of tests for the content of e-mails which leads to problems like here: #893276: Need tests for activation link in new user e-mail

The attached patch modifies assertMail() so that it also returns TRUE if only a part of the field-content is given as $value.

CommentFileSizeAuthor
simpletest_assertMail_extender.patch1.68 KBreglogge

Comments

Status: Needs review » Needs work

The last submitted patch, simpletest_assertMail_extender.patch, failed testing.

reglogge’s picture

Status: Needs work » Closed (works as designed)

How stupid of me: assertMailString() does exactly that...