The following has been changed:

  1. The TestingMailSystem class now implements a stripped down format() method to make the resulting message body more comparable using assertMail(). Currently, to be able to compare the captured result of a drupal_mail() action, you have to convert and wrap the body before comparison, which is not what we want (rather the convert and wrap functions used in the default mail implementation need their own tests).
  2. assertMail() has been enhanced to support validation of the 'headers' sub-array (required for the drupal_mail() test).
  3. MailTestCase class was duplicating TestingMailSystem in parts: this was not necessary and has been simplified, testPluggableFramework() now directly validates the implementation returned by drupal_mail_system() for a given module/key pair.
  4. Last not least, added a test to validate the message structure created by drupal_mail().
CommentFileSizeAuthor
mail_test.patch7.64 KBsmk-ka

Comments

sun’s picture

Issue tags: +API clean-up

Status: Needs review » Needs work

The last submitted patch failed testing.

dave reid’s picture

Component: base system » mail system

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.