Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#42714 new defect (bug)

Unit tests: Move remaining classes out of includes/utils.php into their own file

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


The includes/utils.php file includes four classes:

  • MockAction
  • testXMLParser
  • MockClass
  • wpdb_exposed_methods_for_testing

The patch moves these classes into their own files, as this makes the code more transparent, and easier to add documentation.

The files are now loaded during bootstrap. Moving classes out of files can lead to issues, as seen in #37523.

Rather than continue loading these files always in includes/utils.php, one way to get around this is to check for these classes being loaded at the top utils.php. If not, they can be loaded, and an error message can be triggered, so that developers can update their code.

This backwards compatibility layer could then be removed after having it there for one major release.

Attachments (1)

42714.patch (12.2 KB) - added by Frank Klein 7 years ago.

Download all attachments as: .zip

Change History (3)

@Frank Klein
7 years ago

#1 @Frank Klein
7 years ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #core-committers by johnbillion. View the logs.

7 years ago

Note: See TracTickets for help on using tickets.