Tests: Introduce reset_phpmailer_instance() function.

This function provides a more convenient method for resetting the
PHPMailer instance than the previous technique of reaching into the global.

Props welcher.
Fixes #36658.

git-svn-id: https://develop.svn.wordpress.org/trunk@37358 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2016-05-04 03:48:46 +00:00
parent 23b3f3e2ee
commit 8e417dd09b
4 changed files with 26 additions and 9 deletions
+2 -2
View File
@@ -6,11 +6,11 @@
class Tests_Mail extends WP_UnitTestCase {
function setUp() {
parent::setUp();
unset( $GLOBALS['phpmailer']->mock_sent );
reset_phpmailer_instance();
}
function tearDown() {
unset( $GLOBALS['phpmailer']->mock_sent );
reset_phpmailer_instance();
parent::tearDown();
}