Normal mail sending goes fine inside a Simpletest WebTest, but direct calls do mimemail (in my case, useful for sending mail with attachments) are not intercepted. This patch simply does that automatically when smtp_library is set to Simpletest's drupal_mail_wrapper.

CommentFileSizeAuthor
#1 mimemail.simpletest.patch611 bytesfranz
mimemail.simpletest.patch579 bytesfranz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

franz’s picture

FileSize
611 bytes

Better patch, set message id to be stored within test.

sgabe’s picture

@franz: Could you share the test you are using with this?

franz’s picture

sorry, switched jobs... Don't have access to that code anymore, and I don't remember in detail. I think it was a complex setup with rules that would send HTML notifications, and I wanted to assert them.

sgabe’s picture

Then what should we support here exactly?

franz’s picture

This patch is about supporting automated tests that send e-mails through mimemail. Simpletest sets itself as a mail engine, and it stores all mail sent without really sending it.

sgabe’s picture

Is this patch a general solution? A test would be awesome to test it and see...

sdague’s picture

This looks like it should be a general solution, but because mimemail has no direct interface for sending email it would make it hard to directly test via simpletest. I'd love to see this included so that I could actually test the node_announce mimemail integration (right now I can only automatically test email sending without mimemail)

TR’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Drupal 6 is no longer supported, and mail handling in D7 is different so this issue does not directly apply to D7.