[wp-trac] [WordPress Trac] #42797: Add missing parameter description in wp_get_post_parent_id function DocBlock

WordPress Trac noreply at wordpress.org
Wed Dec 27 08:34:11 UTC 2017


#42797: Add missing parameter description in wp_get_post_parent_id function
DocBlock
--------------------------------------+-----------------------------
 Reporter:  keesiemeijer              |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  5.0
Component:  Posts, Post Types         |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  docs
--------------------------------------+-----------------------------
Changes (by Frank Klein):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Reopening this because the unit tests are not of an acceptable quality:
 1. Shared fixtures should be used whenever possible. The test suite is
 already slow, and we should keep it from getting slower unnecessarily.
 2. The global `$post` is an instance of `WP_Post`, and not an integer
 (post id).

 Two smaller improvements:
 1. `assertSame()` should be preferred, because the checks are stricter.
 2. `assertInstanceOf()` is a shorter way to determine the type of an
 object.

 Also the global `$post` gets reset after every test, so no need to do it
 manually.

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


More information about the wp-trac mailing list