Make WordPress Core

Changeset 64833


Ignore:
Timestamp:
10/27/2026 07:52:16 PM (17 hours ago)
Author:
lancewillett
Message:

Tests: Reset the mock mailer around user tests.

Reset the mock mailer during setup and teardown so captured messages and mailer state do not leak between user tests.

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/14690

Props devmuhib, huzaifaalmesbah.
See #65893.

File:
1 edited

Legend:

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

    r64640 r64833  
    6464                parent::set_up();
    6565
     66                reset_phpmailer_instance();
     67
    6668                add_action( 'set_auth_cookie', array( $this, 'action_set_auth_cookie' ), 10, 6 );
    6769                add_action( 'set_logged_in_cookie', array( $this, 'action_set_logged_in_cookie' ), 10 );
    … …  
    7173
    7274                $this->author = clone self::$_author;
     75        }
     76
     77        public function tear_down() {
     78                reset_phpmailer_instance();
     79
     80                parent::tear_down();
    7381        }
    7482
Note: See TracChangeset for help on using the changeset viewer.