Wordpress/tests/phpunit/includes
Sergey Biryukov ef6973b7f0 Bootstrap/Load: Make handling the /favicon.ico requests more flexible.
Previously, `wp_favicon_request()` was introduced in [13205] to avoid a performance hit of serving a full 404 page on every favicon request.

While working as intended, that implementation did not provide a way for theme or plugin authors to manage the behavior of favicon requests.

This changeset implements the following logic (only applied if WordPress is installed in the root directory):

* If there is a Site Icon set in Customizer, redirect `/favicon.ico` requests to that icon.
* Otherwise, use the WordPress logo as a default icon.
* If a physical `/favicon.ico` file exists, do nothing, let the server handle the request.

Handling `/favicon.ico` is now more consistent with handling `/robots.txt` requests.

New functions and hooks:

* Introduce `is_favicon()` conditional tag to complement `is_robots()`.
* Introduce `do_favicon` action to complement `do_robots` and use it in template loader.
* Introduce `do_favicon()` function, hooked to the above action by default, to complement `do_robots()`.
* Introduce `do_faviconico` action to complement `do_robotstxt`, for plugins to override the default behavior.
* Mark `wp_favicon_request()` as deprecated in favor of `do_favicon()`.

Props jonoaldersonwp, birgire, joostdevalk, mukesh27, SergeyBiryukov.
Fixes #47398.

git-svn-id: https://develop.svn.wordpress.org/trunk@47018 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-28 21:18:03 +00:00
..
factory Docs: Improve @return description for wp_update_comment() and WP_UnitTest_Factory_For_Comment::update_object(). 2019-12-27 00:28:39 +00:00
phpunit6 Code Modernization: Pass an appropriate error level to trigger_error() in _doing_it_wrong() and related functions: 2019-11-01 00:39:04 +00:00
phpunit7 Tests: Docs: Correct @param formatting in SpeedTrapListener after [35226] and [45607]. 2019-12-11 15:46:51 +00:00
abstract-testcase.php Bootstrap/Load: Make handling the /favicon.ico requests more flexible. 2019-12-28 21:18:03 +00:00
bootstrap.php Tests: Replace "blog" reference in a comment about DISABLE_WP_CRON usage with "site". 2019-09-20 21:58:42 +00:00
class-basic-object.php REST API: Support 'object' and 'array' types in register_meta() schemas. 2019-08-15 17:16:21 +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 REST API: Add test class file incorrectly omitted from [45807]. 2019-08-15 17:20:02 +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-search-handler.php REST API: Introduce controller for searching across post types. 2018-12-13 09:37:05 +00:00
exceptions.php
factory.php Add tests for get_bookmarks() cache. 2016-05-25 18:20:24 +00:00
functions.php Tests: Merge [24251] from _wp_filter_build_unique_id() to _test_filter_build_unique_id(), for consistency. 2019-11-29 22:15:31 +00:00
install.php Coding Standards: Fix the remaining issues in /tests. 2019-07-08 00:55:20 +00:00
listener-loader.php Build/Test Tools: Add support for PHPUnit 7.x. 2019-01-28 14:10:24 +00:00
mock-fs.php Coding Standards: Fix the remaining issues in /tests. 2019-07-08 00:55:20 +00:00
mock-image-editor.php Code is Poetry. 2017-11-30 23:09:33 +00:00
mock-mailer.php Code is Poetry. 2017-11-30 23:09:33 +00:00
object-cache.php Build Tools: Switch all Travis PHPUnit jobs over to Docker-based PHP. 2019-08-07 11:54:22 +00:00
plural-form-function.php Coding Standards: Ignore the single WordPress.PHP.RestrictedPHPFunctions.create_function_create_function violation. 2019-01-11 03:44:20 +00:00
speed-trap-listener.php Tests: Docs: Correct @param formatting in SpeedTrapListener after [35226] and [45607]. 2019-12-11 15:46:51 +00:00
spy-rest-server.php Code is Poetry. 2017-11-30 23:09:33 +00:00
testcase-ajax.php Privacy: Add unit tests for exporting and erasing personal data. 2019-03-15 18:07:09 +00:00
testcase-canonical.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in tests. 2019-07-02 04:43:01 +00:00
testcase-rest-api.php REST API: Introduce baby API to the world. 2015-10-08 02:30:18 +00:00
testcase-rest-controller.php REST API: Include permalink_template/generated_slug for Posts 2018-12-12 02:11:22 +00:00
testcase-rest-post-type-controller.php Date/Time: Replace all instances of date() with gmdate(). 2019-05-26 00:11:37 +00:00
testcase-xmlrpc.php Code is Poetry. 2017-11-30 23:09:33 +00:00
testcase.php Build/Test Tools: Add support for PHPUnit 7.x. 2019-01-28 14:10:24 +00:00
trac.php Coding Standards: Fix the remaining issues in /tests. 2019-07-08 00:55:20 +00:00
utils.php Tests: Remove a workaround for str_getcsv(). 2019-09-20 22:43:50 +00:00
wp-profiler.php Coding Standards: Fix the remaining issues in /tests. 2019-07-08 00:55:20 +00:00