[wp-trac] [WordPress Trac] #29781: Unit tests for WP_Date_Query
WordPress Trac
noreply at wordpress.org
Mon Sep 29 01:33:10 UTC 2014
#29781: Unit tests for WP_Date_Query
--------------------------+-----------------------------
Reporter: boonebgorges | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
`WP_Date_Query` has pretty decent integration tests (in the form of the
posts queries in `/tests/phpunit/tests/query/dateQuery.php`, but it has no
coverage at all of the class itself. The attached patch covers pretty much
all publicly available functionality in `WP_Date_Query`.
In writing the tests, I found a couple bugs - places where passing a
certain kind of value can result in getting integer-cast to 1, which will
return improper results rather than no results at all. But for this patch,
I've opted to write all the tests so that they pass, ie so that they
describe how `WP_Date_Query` currently works. I'll submit fixes for the
bugs once these tests have been committed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29781>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list