[wp-trac] [WordPress Trac] #31134: register_post_type() should call a _doing_it_wrong() when called with an empty post type name

WordPress Trac noreply at wordpress.org
Mon Jan 26 08:00:25 UTC 2015


#31134: register_post_type() should call a _doing_it_wrong() when called with an
empty post type name
----------------------------------------+------------------
 Reporter:  tyxla                       |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.2
Component:  Posts, Post Types           |     Version:  3.0
 Severity:  minor                       |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------
Changes (by DrewAPicture):

 * keywords:  has-patch => has-patch needs-unit-tests


Comment:

 Replying to [comment:4 tyxla]:

 Since the issues between registering taxonomies and post types are fairly
 aligned, see comment:5:ticket:31135 for how I would approach the tests for
 this, except for post types instead of taxonomies. The difference of
 course would be that there isn't currently a test that I can find for
 either short or long post types.

 So in this case, maybe creating a single
 `test_register_post_type_length()` would suffice, again, following similar
 syntax to that of `test_register_long_taxonomy()` – in terms of:

 * Notating the ticket number
 * Using `@expectedIncorrectUsage`
 * Checking for the `WP_Error` object to confirm instead of the
 `_doing_it_wrong()`

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


More information about the wp-trac mailing list