Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#36609 closed defect (bug) (fixed)

Unit tests in Tests_Mail not resetting the phpmailer mock

Reported by: welcher's profile welcher Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch dev-feedback
Focuses: Cc:

Description

While writing some tests for #33932, I found that the Test_Mail class was not reseting the phpmailer mock after the last test because the unset( $GLOBALS['phpmailer']->mock_sent ); was only happening in setUp().

Attachments (1)

36609.diff (423 bytes) - added by welcher 8 years ago.
Adding tearDown() to cleanup after last test

Download all attachments as: .zip

Change History (5)

@welcher
8 years ago

Adding tearDown() to cleanup after last test

#1 @welcher
8 years ago

  • Milestone changed from Awaiting Review to 4.6

This ticket was mentioned in Slack in #core by welcher. View the logs.


8 years ago

#3 @welcher
8 years ago

  • Keywords dev-feedback added

#4 @SergeyBiryukov
8 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 37307:

Build/Test Tools: Reset the PHPMailer mock in Tests_Mail::tearDown().

Props welcher.
Fixes #36609.

Note: See TracTickets for help on using tickets.