Make WordPress Core

Ticket #41485: 41485.patch

File 41485.patch, 520 bytes (added by pessoft, 7 years ago)

Create a new MockPHPMailer instance on reset instead just unsetting mock_sent

  • tests/phpunit/includes/mock-mailer.php

     
    9494 */
    9595function reset_phpmailer_instance() {
    9696        $mailer = tests_retrieve_phpmailer_instance();
    97         if ( $mailer && isset( $mailer->mock_sent ) ) {
    98                 unset( $mailer->mock_sent );
     97        if ( $mailer ) {
     98                $GLOBALS['phpmailer'] = new MockPHPMailer( true );
    9999                return true;
    100100        }
    101101