[wp-trac] [WordPress Trac] #56740: set_up_before_class() / wpSetUpBeforeClass() are inconsistent and confusing
WordPress Trac
noreply at wordpress.org
Wed Oct 5 22:22:33 UTC 2022
#56740: set_up_before_class() / wpSetUpBeforeClass() are inconsistent and confusing
------------------------------+------------------------------
Reporter: iandunn | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version: 4.4
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+------------------------------
Comment (by SergeyBiryukov):
Some context from #55918:
* The main differences from `set_up_before_class()` /
`tear_down_after_class()`:
* `wpSetUpBeforeClass()` receives the `$factory` argument for ease of
use.
* Both `wpSetUpBeforeClass()` and `wpTearDownAfterClass()` don't need to
call `self::commit_transaction()`.
* `wpSetUpBeforeClass()` / `wpSetUpAfterClass()` should not be confused
with the native PHPUnit methods that need to be replaced with WordPress'
`snake_case` counterparts, as the tests would not pass across all
supported PHP and PHPUnit versions otherwise:
* `setUpBeforeClass()` → `set_up_before_class()`
* `tearDownAfterClass()` → `tear_down_after_class()`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56740#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list