wordpress-develop/tests/phpunit/includes
Joe McGill 618e42240f Themes: Use original template paths when switching blogs.
This fixes a bug introduced by [57129] and [56635] in which deprecating the previous  `TEMPLATEPATH` and `STYLESHEETPATH` constants in favor of `get_template_directory()` and `get_stylesheet_directory()` functions caused the active theme template path to change when using `switch_to_blog()`.

This introduces a new function, `wp_set_template_globals()`, which is called during the bootstrap process to store the template paths to new globals values `$wp_template_path` and `$wp_stylesheet_path`. This restores behavior to how things worked prior to [56635] but retains the ability for template values to be reset for better testability.

Related #18298, #60025.

Props joemcgill, flixos90, mukesh27, swissspidy, manfcarlo, metropolis_john, jeremyfelt.
Fixes #60290.


git-svn-id: https://develop.svn.wordpress.org/trunk@57685 602fd350-edb4-49c9-b593-d223f7449a82
2024-02-21 19:24:12 +00:00
..
factory General: Remove discouraged @return void annotations. 2023-10-16 15:15:14 +00:00
phpunit6 Coding Standards: Remove superfluous blank lines at the end of various classes. 2023-09-08 09:30:38 +00:00
abstract-testcase.php Themes: Use original template paths when switching blogs. 2024-02-21 19:24:12 +00:00
bootstrap.php Code Modernization: Use dirname() with the $levels parameter. 2023-09-11 04:51:09 +00:00
class-basic-object.php Tests: Correct magic methods in Basic_Object. 2022-09-07 15:59:16 +00:00
class-basic-subclass.php Build/Test tools: Remove unnecessary PHP functionality tests from the test suite. 2017-12-09 23:08:24 +00:00
class-jsonserializable-object.php Code Modernization: Fix "JsonSerializable_Object::jsonSerialize() should be compatible with JsonSerializable::jsonSerialize(): mixed" error on PHP 8.1. 2021-07-30 14:46:30 +00:00
class-wp-fake-block-type.php Blocks: Introduce WP_Block_Type and WP_Block_Type_Registry classes. 2018-12-13 09:43:29 +00:00
class-wp-rest-test-configurable-controller.php REST API: Don't assume all item schemas have properties. 2020-02-20 16:56:17 +00:00
class-wp-rest-test-search-handler.php REST API: Introduce controller for searching across post types. 2018-12-13 09:37:05 +00:00
class-wp-sitemaps-empty-test-provider.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:48:43 +00:00
class-wp-sitemaps-large-test-provider.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:48:43 +00:00
class-wp-sitemaps-test-provider.php Docs: Various corrections and improvements relating to types used in inline documentation. 2021-11-18 13:48:43 +00:00
class-wp-test-stream.php Tests: Correct the WP_Test_Stream::mkdir() method. 2023-10-24 11:32:42 +00:00
exceptions.php Docs: Improve documentation for tests/phpunit/includes/testcase-ajax.php. 2020-01-05 15:31:10 +00:00
factory.php Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant. 2020-02-06 06:31:22 +00:00
functions.php Editor: Register the Google Font collection. 2024-02-08 07:36:36 +00:00
install.php Docs: Improve PHPCS comments general consistency. 2023-08-25 05:09:09 +00:00
mock-fs.php Coding Standards: Remove superfluous blank lines at the end of various functions. 2023-09-08 10:01:14 +00:00
mock-image-editor.php Coding Standards: Remove superfluous blank lines at the end of various functions. 2023-09-08 10:01:14 +00:00
mock-invokable.php Docs: Miscellaneous DocBlock corrections. 2021-11-24 23:58:20 +00:00
mock-mailer.php Coding Standards: Add public visibility to methods in tests/phpunit/includes/. 2021-11-04 13:15:33 +00:00
normalize-xml.xsl Sitemaps: Add XML sitemaps functionality to WordPress. 2020-06-17 15:22:49 +00:00
object-cache.php General: Remove discouraged @return void annotations. 2023-10-16 15:15:14 +00:00
phpunit-adapter-testcase.php Build/Test Tools: Update PHPUnit Polyfills to version 1.1.0. 2023-08-21 15:53:04 +00:00
plural-form-function.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
spy-rest-server.php Tests: Avoid an infinite loop in Spy_REST_Server if a non-existing method is called. 2023-11-23 14:39:16 +00:00
testcase-ajax.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
testcase-canonical.php Tests: Correct references to set_up() and tear_down() in various DocBlocks. 2022-11-22 21:25:27 +00:00
testcase-rest-api.php Coding Standards: Use instanceof keyword instead of the is_a() function. 2023-08-03 12:08:30 +00:00
testcase-rest-controller.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:49:49 +00:00
testcase-rest-post-type-controller.php REST API: Add featured_media field to attachments endpoint. 2024-02-12 22:15:45 +00:00
testcase-xml.php Docs: Improve PHPCS comments general consistency. 2023-08-25 05:09:09 +00:00
testcase-xmlrpc.php Coding Standards: Remove superfluous blank lines at the end of various classes. 2023-09-08 09:30:38 +00:00
testcase.php Build/Test Tools: Change the inheritance order of the abstract test classes. 2021-08-06 00:44:00 +00:00
trac.php Docs: Fix typo in TracTickets::isTracTicketClosed() description. 2022-02-20 10:12:37 +00:00
unregister-blocks-hooks.php Editor: Update the WordPress packages to Gutenberg 17.7RC1. 2024-02-09 18:20:12 +00:00
utils.php Build/Test Tools: Fix docblocks in a couple of test files to use two asterisks. 2024-02-20 12:40:57 +00:00
wp-profiler.php Build/Test Tools: Fix docblocks in a couple of test files to use two asterisks. 2024-02-20 12:40:57 +00:00