Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | mimemail.simpletest.patch | 611 bytes | franz |
mimemail.simpletest.patch | 579 bytes | franz | |
Comments
Comment #1
franzBetter patch, set message id to be stored within test.
Comment #2
sgabe CreditAttribution: sgabe commented@franz: Could you share the test you are using with this?
Comment #3
franzsorry, 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.
Comment #4
sgabe CreditAttribution: sgabe commentedThen what should we support here exactly?
Comment #5
franzThis 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.
Comment #6
sgabe CreditAttribution: sgabe commentedIs this patch a general solution? A test would be awesome to test it and see...
Comment #7
sdague CreditAttribution: sdague commentedThis 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)
Comment #8
TR CreditAttribution: TR commentedDrupal 6 is no longer supported, and mail handling in D7 is different so this issue does not directly apply to D7.