From 37ce2ffe854259de106da85d167909eb5404eb0b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 29 Jul 2017 20:52:45 +0000 Subject: [PATCH] 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 --- tests/phpunit/includes/mock-mailer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/includes/mock-mailer.php b/tests/phpunit/includes/mock-mailer.php index 7acfd579ba..452770521e 100644 --- a/tests/phpunit/includes/mock-mailer.php +++ b/tests/phpunit/includes/mock-mailer.php @@ -94,8 +94,8 @@ function tests_retrieve_phpmailer_instance() { */ function reset_phpmailer_instance() { $mailer = tests_retrieve_phpmailer_instance(); - if ( $mailer && isset( $mailer->mock_sent ) ) { - unset( $mailer->mock_sent ); + if ( $mailer ) { + $GLOBALS['phpmailer'] = new MockPHPMailer( true ); return true; }