WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 9 days ago

#53987 new enhancement

add tests for wp_list_filter

Reported by: pbearne Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description


Change History (16)

This ticket was mentioned in PR #1614 on WordPress/wordpress-develop by pbearne.


5 months ago

  • Keywords has-patch has-unit-tests added

wpListeFilter.php claimed to test wp_list_filter but had no tests for it so I have added them

Trac ticket: https://core.trac.wordpress.org/ticket/53987

#3 @SergeyBiryukov
5 months ago

  • Milestone changed from Awaiting Review to 5.9

#4 @SergeyBiryukov
5 months ago

Thanks for the PR!

Just noting there also some existing tests for wp_list_filter() in tests/functions/wpListUtil.php.

It looks like:

  • wpListFilter.php has tests for wp_filter_object_list() and wp_list_pluck().
  • wpListUtil.php has tests for wp_list_pluck(), wp_list_filter(), wp_list_sort(), and the WP_List_Util class.

This could probably use some reorganization for clarity and to make sure the tests are not duplicated.

#5 @SergeyBiryukov
5 months ago

In 51663:

Tests: Move wp_list_pluck() tests to their own file.

The tests were partially duplicated in two separate files.

Follow-up to [431/tests], [28900], [38928], [42527].

See #53363, #53987.

#6 @SergeyBiryukov
5 months ago

In 51664:

Tests: Remove duplicate wp_list_pluck() tests.

The tests were partially duplicated in two separate files, and are now located in their own file.

Follow-up to [431/tests], [28900], [38928], [42527], [51663].

See #53363, #53987.

#7 @SergeyBiryukov
5 months ago

In 51665:

Tests: Rename the test file and class for wp_filter_object_list() tests.

This matches the name of the function being tested.

Follow-up to [410/tests], [51663], [51664].

See #53363, #53987.

#8 @SergeyBiryukov
5 months ago

In 51666:

Tests: Move wp_list_filter() tests to their own file.

This matches the name of the function being tested.

Follow-up to [38928], [51663-51665].

See #53363, #53987.

#9 @SergeyBiryukov
5 months ago

In 51667:

Tests: Move wp_list_sort() tests to their own file.

This matches the name of the function being tested.

Follow-up to [38928], [51663-51666].

See #53363, #53987.

#10 @SergeyBiryukov
5 months ago

In 51668:

Coding Standards: Add missing visibility keywords for wp_filter_object_list() and wp_list_pluck() tests.

Follow-up to [51663-51667].

Props pbearne.
See #53363, #53987.

#11 @SergeyBiryukov
5 months ago

What's left here:

  • See if wp_list_pluck() tests can be simplified further. Some use older fixtures and some use a data provider, so we could review the older fixtures and move them to the data provider too if it does not cover those cases yet.
  • See if any additional tests for wp_list_filter() are necessary and not already covered by the data provider.

#12 @prbot
2 months ago

hellofromtonya commented on PR #1614:

Good work here @pbearne. Can you rebase with master to resolve the merge conflict. Then it should be ready.

#13 @pbearne
2 months ago

My patch is not now needed closing pull request

#14 @prbot
2 months ago

pbearne commented on PR #1614:

the updated test replaces this patch
closing

#15 @hellofromTonya
2 months ago

  • Milestone changed from 5.9 to Future Release

Today is 5.9 Feature Freeze. I'll punt this to Future Release (as 6.0 isn't
available yet for selection).

Test and build tool changes are allowed after feature freeze up until RC. If someone is able to work on this before then, it can always be moved back.

#16 @johnbillion
9 days ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.