[wp-trac] [WordPress Trac] #55918: Call wpTearDownAfterClass() before deleting all data, instead of after
WordPress Trac
noreply at wordpress.org
Tue Sep 20 23:23:27 UTC 2022
#55918: Call wpTearDownAfterClass() before deleting all data, instead of after
--------------------------------------+---------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.1
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+---------------------
Comment (by ironprogrammer):
Due to
[https://wordpress.slack.com/archives/C03B0H5J0/p1661878866652479?thread_ts=1661878420.775379&cid=C03B0H5J0
lingering questions] related to the continued use of
`wpSetUpBeforeClass()` / `wpTearDownAfterClass()`, versus
[https://make.wordpress.org/core/handbook/testing/automated-testing
/writing-phpunit-tests/#shared-fixtures recent Core Handbook guidance to
favor the newer] `set_up_before_class()` / `tear_down_after_class()`
methods, I propose punting this for further exploration and consensus.
For more background on the shift to use the `snake_case` methods, see
[https://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-
php-test-suite/#core-contributors-writing-tests Changes to the WordPress
Core PHP Test Suite] (27 September 2021).
And for completeness, the Core Handbook also mentions the older methods in
the [https://make.wordpress.org/core/handbook/testing/automated-testing
/writing-phpunit-tests/#slow-fixtures Slow Fixtures] section. Additional
discussion should pave a way forward to reconcile these differences.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55918#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list