custom-post-type-ui icon indicating copy to clipboard operation
custom-post-type-ui copied to clipboard

Add new labels to unit tests

Open tw2113 opened this issue 9 years ago • 4 comments

Want to make sure we're getting good coverage.

tw2113 avatar Feb 26 '16 04:02 tw2113

Which labels? Added to which unit tests?

GaryJones avatar Nov 14 '17 20:11 GaryJones

You'll find half of the issues are just personal notes, not conductive to outside contributions :P It would new CPT/Taxonomy labels added in recent-ish versions

tw2113 avatar Nov 14 '17 21:11 tw2113

For future contributors, who don't want to go a'hunting:

  • Test for CPT labels - see https://developer.wordpress.org/reference/functions/get_post_type_labels/ for the up-to-date list of post type labels.
  • Test for CTax labels - see https://developer.wordpress.org/reference/functions/get_taxonomy_labels/ for up-to-date list of taxonomy labels.

Suggestion: Add a @since tag to each test DocBlock to say up to which version of WP the labels now cover. i.e.

/**
 * Tests for our registered labels for the post type.
 *
 * @since 0.9.0
 * @since 1.6.0 Added the `featured_image`, `set_featured_image`, `remove_featured_image`
 *              and `use_featured_image` labels (all WP 4.3.0).
 *              Added `the archives`, `insert_into_item`, `uploaded_to_this_item`, `filter_items_list`, 
 *              `items_list_navigation`, and `items_list` labels (all WP 4.4.0).
 *              Added the `view_items` and `attributes` labels (both WP 4.7.0).
 */
/**
 * Tests for our registered labels for the taxonomy.
 *
 * @since 0.9.0
 * @since 1.6.0 Added the `no_terms` (WP 4.3.0), the `items_list_navigation` (WP 4.4.0)
 *              and `items_list labels` (WP 4.4.0) labels.
 */

(They should be the correct labels to add as of right now.)

GaryJones avatar Nov 14 '17 23:11 GaryJones

There's likely more we can do with this, but 423-update-unit-test-options is a start.

tw2113 avatar Sep 13 '22 00:09 tw2113

Manually merged in to release1140 branch

tw2113 avatar Oct 24 '22 16:10 tw2113