Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#54713 closed task (blessed) (fixed)

Build/Test Tools: Add unit tests for `feed_links_extra()`.

Reported by: costdev's profile costdev Owned by: hellofromtonya's profile hellofromTonya
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:


feed_links_extra() currently has no test coverage.

This ticket aims to add 100% line/branch coverage to feed_links_extra().

Attachments (1)

feed_links_extra coverage.jpg (26.8 KB) - added by costdev 3 years ago.
100% line/branch coverage for feed_links_extra().

Download all attachments as: .zip

Change History (9)

This ticket was mentioned in PR #2100 on WordPress/wordpress-develop by costdev.

3 years ago

  • Keywords has-patch has-unit-tests added

This PR achieves 100% line/branch coverage for feed_links_extra().

One source change was made in WP_Query:

  • WP_Query previously did not set is_post_type_archive to true when an array of post types was supplied.
  • Other areas of the codebase, including areas in WP_Query, handle a post type array using reset().
  • This PR uses the same approach.

Commits have been separated for easier review and cherry-picking.

Trac ticket:

3 years ago

100% line/branch coverage for feed_links_extra().

#2 @costdev
3 years ago

PR ready for review.

#3 @hellofromTonya
3 years ago

  • Keywords early added
  • Milestone changed from 5.9 to 6.0

The PR/patch touches WP_Query. Given that tomorrow is 5.9 RC1 and trunk will become 6.0-alpha, moving this to 6.0 and marking it as early. Why? Changes to WP_Query need soak time. It's too late in the 5.9 cycle to touch this mission critical file.

#4 @hellofromTonya
2 years ago

  • Owner changed from costdev to hellofromTonya
  • Status changed from assigned to reviewing

Reassigning code review to me to get it into my review queue.

#5 @peterwilsoncc
2 years ago

  • Keywords early removed

I discussed this with @costdev via Slack.

To avoid making changes to WP_Query in a ticket designed to add tests, the tests that fail without the query changes will be left out for this release.

A follow up ticket will be created to fix the bug that was found while writing the tests. And to decide whether the bug is in feeds or WP_Query.

Removing the early keyword as this will no longer touch WP_Query.

#6 @peterwilsoncc
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 53033:

Build/Test Tools: Add unit tests for feed_links_extra().

Props costdev, hellofromTonya.
Fixes #54713.
See #54725.

peterwilsoncc commented on PR #2100:

2 years ago

Committed in d2ab3d183740c3d1252cb921b18005495007e022,

#8 @peterwilsoncc
2 years ago

@costdev I've committed the tests that were passing as noted above.

Are you able to create a follow up ticket for the is_post_type_archive issue you discovered and note it here?

That will allow the tests to hit 100% once it's decided which piece of code is buggy.

Note: See TracTickets for help on using tickets.