[wp-trac] [WordPress Trac] #28618: Allow PHPMailer class to be reliably overriden

WordPress Trac noreply at wordpress.org
Tue Aug 19 23:48:58 UTC 2025


#28618: Allow PHPMailer class to be reliably overriden
-------------------------------------------------+-------------------------
 Reporter:  leewillis77                          |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Mail                                 |     Version:  4.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests close       |     Focuses:
  reporter-feedback                              |
-------------------------------------------------+-------------------------
Changes (by SirLouen):

 * keywords:  needs-test-info has-patch has-unit-tests => has-patch has-
     unit-tests close reporter-feedback


Comment:

 After re-reading and trying to play around with this, I still don't really
 understand how this can happen from outside the PHPUnit suite.

 But if we focus on a Unit Tests perspective, it's true that unsetting the
 global, brings a real PHP Mailer object instead of keeping it Mock. I've
 added a Unit Test to demo this.

 The idea behind this report is definitely legit, but personally, I don't
 love this kind of reports that I cannot prove them with a real life case.

 Despite personally doing some work on this report and demonstrating the
 issue with a unit test and refreshing the patch, I'm going to set this to
 `close` as for me, it's totally unclear what value is providing. I would
 rather prefer to close this ticket if no answer is given and maybe if
 someone happens to find it in the future or the reporter happens to
 provide some extra info, consider reopening it and further working on
 reviewing all this with more data at hand.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/28618#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list