Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#42903 closed enhancement (fixed)

Speed up tests for `wp_list_pages()`

Reported by: frank-klein's profile Frank Klein Owned by: boonebgorges's profile boonebgorges
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

The fixtures in Tests_List_Pages are (re)created in the setUp() method before every test run. Additionally, they rely on hardcoded post ids.

The attached patch uses shared fixtures, and dynamic data. It also contains smaller changes to get around having to align all variable declarations in a method, which looks weird.

Attachments (1)

42903.patch (39.1 KB) - added by Frank Klein 7 years ago.

Download all attachments as: .zip

Change History (6)

@Frank Klein
7 years ago

#1 @Frank Klein
7 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 5.0

#3 @boonebgorges
7 years ago

  • Owner set to boonebgorges
  • Status changed from new to reviewing

<3 - thanks so much for the patch, @Frank Klein.

#4 @boonebgorges
7 years ago

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

In 42402:

Improve performance of wp_list_pages() tests.

The changeset also removes the use of hardcoded post/author IDs.

Props frank-klein.
Fixes #42903.

#5 @jorbin
6 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.