MDL-41196 Unit Tests: Add a phpmailer message sink

This commit is contained in:
Andrew Nicols
2013-08-18 16:15:58 +01:00
parent 661777c503
commit 6e8edc5af0
5 changed files with 171 additions and 0 deletions
+13
View File
@@ -319,6 +319,19 @@ abstract class advanced_testcase extends PHPUnit_Framework_TestCase {
return phpunit_util::start_message_redirection();
}
/**
* Starts email redirection.
*
* You can verify if email were sent or not by inspecting the email
* array in the returned phpmailer sink instance. The redirection
* can be stopped by calling $sink->close();
*
* @return phpunit_message_sink
*/
public function redirectEmails() {
return phpunit_util::start_phpmailer_redirection();
}
/**
* Cleanup after all tests are executed.
*