Tests: Fully reset MockPHPMailer between tests.

Props pessoft.
Fixes #41485.

git-svn-id: https://develop.svn.wordpress.org/trunk@41185 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-07-29 20:52:45 +00:00
parent bf39951441
commit 37ce2ffe85

View File

@ -94,8 +94,8 @@ function tests_retrieve_phpmailer_instance() {
*/ */
function reset_phpmailer_instance() { function reset_phpmailer_instance() {
$mailer = tests_retrieve_phpmailer_instance(); $mailer = tests_retrieve_phpmailer_instance();
if ( $mailer && isset( $mailer->mock_sent ) ) { if ( $mailer ) {
unset( $mailer->mock_sent ); $GLOBALS['phpmailer'] = new MockPHPMailer( true );
return true; return true;
} }