MDL-41196 Unit Tests: Add a phpmailer message sink
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user