WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/04/2016 03:48:46 AM (2 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user.php

    r37277 r37358  
    10251025     */
    10261026    function test_wp_new_user_notification( $notify, $admin_email_sent_expected, $user_email_sent_expected ) {
    1027         unset( $GLOBALS['phpmailer']->mock_sent );
     1027        reset_phpmailer_instance();
    10281028
    10291029        $was_admin_email_sent = false;
     
    11011101     */
    11021102    function test_wp_new_user_notification_old_signature_throws_deprecated_warning_but_sends() {
    1103         unset( $GLOBALS['phpmailer']->mock_sent );
     1103        reset_phpmailer_instance();
    11041104
    11051105        $was_admin_email_sent = false;
     
    11261126     */
    11271127    function test_wp_new_user_notification_old_signature_no_password() {
    1128         unset( $GLOBALS['phpmailer']->mock_sent );
     1128        reset_phpmailer_instance();
    11291129
    11301130        $was_admin_email_sent = false;
Note: See TracChangeset for help on using the changeset viewer.