[wp-trac] [WordPress Trac] #56021: Rename or deprecate assertDiscardWhitespace()
WordPress Trac
noreply at wordpress.org
Mon Jun 20 18:12:26 UTC 2022
#56021: Rename or deprecate assertDiscardWhitespace()
------------------------------+--------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.1
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: |
------------------------------+--------------------
There are a few custom assertion methods in `WP_UnitTestCase_Base`:
* `assertWPError()`
* `assertNotWPError()`
* `assertIXRError()`
* `assertNotIXRError()`
* `assertEqualFields()`
* `assertDiscardWhitespace()`
* `assertSameIgnoreEOL()`
* `assertEqualsIgnoreEOL()`
* `assertSameSets()`
* `assertEqualSets()`
* `assertSameSetsWithIndex()`
* `assertEqualSetsWithIndex()`
* `assertNonEmptyMultidimensionalArray()`
* `assertQueryTrue()`
`assertDiscardWhitespace()` is the odd one out, as it does not match the
naming of other methods. Existing since [760/tests], it appears to have
never been used in the test suite.
I think we can rename it to `assertEqualsDiscardWhitespace()` and keep the
old name as an alias just in case, or deprecate it altogether, maybe
suggesting `assertSameIgnoreEOL()` as a replacement, though it's not quite
the same.
While it is possible that plugins may use the method in their tests,
searching in the directory
[https://wpdirectory.net/search/01G614PXD6J2Q67FDKS8DYS6S3 shows zero
results].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56021>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list