[wp-trac] [WordPress Trac] #64225: Test tool and unit test improvements for 7.0

WordPress Trac noreply at wordpress.org
Tue Mar 3 05:54:09 UTC 2026


#64225: Test tool and unit test improvements for 7.0
--------------------------------------+---------------------
 Reporter:  desrosj                   |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  7.0
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by westonruter):

 In [changeset:"61789" 61789]:
 {{{
 #!CommitTicketReference repository="" revision="61789"
 Code Quality: Normalize `object` as type being supplied as comment, post,
 site, term, and user.

 When constructing these objects, the specific instance type is redundantly
 used in a union with a generic `object`. A generic object can be passed
 directly from database row result. This also hardens `get_post()` to
 account for passing an object that lacks an `ID` property. Similarly,
 `sanitize_term()` is hardened to account for an object lacking a `term_id`
 property. Comprehensive unit tests are added for `get_post()` and
 `sanitize_term()`.

 Developed in https://github.com/WordPress/wordpress-develop/pull/11096

 Props westonruter, apermo.
 See #64238, #64225.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64225#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list