[wp-trac] [WordPress Trac] #42714: Unit tests: Move remaining classes out of includes/utils.php into their own file

WordPress Trac noreply at wordpress.org
Mon Nov 27 15:15:02 UTC 2017


#42714: Unit tests: Move remaining classes out of includes/utils.php into their own
file
------------------------------+-----------------------------
 Reporter:  Frank Klein       |      Owner:
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42714>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list