[wp-trac] [WordPress Trac] #53011: Tests: review all setUp() and tearDown()

WordPress Trac noreply at wordpress.org
Sat Aug 7 16:01:18 UTC 2021

#53011: Tests: review all setUp() and tearDown()
 Reporter:  jrf          |       Owner:  (none)
     Type:  task         |      Status:  new
  (blessed)              |
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Build/Test   |     Version:
  Tools                  |
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  docs, performance, coding-
                         |  standards

Comment (by jrf):

 Related #53746, #50209

 When reviewing the changes proposed in #53746, it also became very clear
 that `setUp()` and `tearDown()` are incorrectly used at this time in the
 WP test suite.

 `setUp()` should prepare the environment for the tests.
 `tearDown()` should bring the environment back to the default state.

 At this time, a lot of "bring back to default state" is done in `setUp()`,
 making the test suite inherently unstable.

 A review of, and improvement to this should be included in this ticket.

Ticket URL: <https://core.trac.wordpress.org/ticket/53011#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list