Home > testing > Does the SimpleTest method drupalGetMails() prevent actual emails from being sent?

Does the SimpleTest method drupalGetMails() prevent actual emails from being sent?

November 13Hits:2
Advertisement

During a SimpleTest, does the data intercepted by drupalGetMails() continue to your systems mail transport agent or is the actual send suppressed?

Answers

That is only the getter.

// Use the test mail class instead of the default mail handler class.
variable_set('mail_system', array('default-system' => 'TestingMailSystem'));

in DrupalWebTestCase::setUp stops mails being sent. TestingMailSystem does nothing else but collect emails in the drupal_test_email_collector variable.

Tags:testing

Related Articles

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.787 s.