Wordpress/tests/phpunit/tests
Sergey Biryukov 9afe01b087 REST API: Shim `post_date_gmt` for drafts / empty dates in the REST API.
Internally, WordPress uses a special `post_date_gmt` value of `0000-00-00 00:00:00` to indicate that a draft's date is "floating" and should be updated whenever the post is saved. This makes it much more difficult for API clients to know the correct date of a draft post.

This commit provides a best guess at a `date_gmt` value for draft posts in this situation using the `date` field and the site's current timezone offset.

Props joehoyle, jnylen0.
Merges [40108] to the 4.7 branch.
Fixes #38883.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40115 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 22:02:48 +00:00
..
actions Build/Test Tools: Continue eliminating randomness in tests. 2016-10-09 01:29:04 +00:00
admin Posts, Post Types: Improve sanitisation of templates' post types. 2016-11-15 03:36:13 +00:00
ajax Customize: Defer populating `post_name` for `auto-draft` posts in customized state until posts are published. 2016-12-05 19:38:16 +00:00
attachment
bookmark
canonical Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available. 2016-09-26 17:01:48 +00:00
category Taxonomy: Prevent `wp_list_categories()` from producing not well-nested output if `hide_title_if_empty` is true. 2016-11-17 18:01:13 +00:00
comment Revert to pre-4.7 behavior for fetching object instances by id. 2017-01-26 16:56:21 +00:00
customize Customize: Extend auto-draft life of a `customize_changeset` post whenever modified. 2017-02-21 07:02:14 +00:00
date Date/Time: Improve `date_i18n()` timezone tests. 2016-11-08 22:31:51 +00:00
db Tests: Restore the database connection earlier when switching test groups. 2016-12-21 05:07:05 +00:00
dependencies Build/Test Tools: Utilise `assertFileExists()` and `assertFileNotExists()` in more places. 2016-11-08 23:49:11 +00:00
external-http De-Emphasise the minor (x.y.Z) version in `readme.html` by including only the major version for the 4.7 branch. 2016-12-12 07:59:10 +00:00
feed Feeds: Prevent empty feeds from returning 404 errors. 2017-02-20 06:37:22 +00:00
filesystem
formatting Formatting: fix `wpautop()` to stop adding paragraph tags around `<figcaption>`. 2017-02-21 03:41:42 +00:00
functions General: Introduce a `wp_list_sort()` helper function, v2. 2016-10-25 21:25:25 +00:00
general Build/Test Tools: Utilise `assertWPError()` and `assertNotWPError()` in more places. 2016-11-09 00:01:42 +00:00
hooks Build/Test Tools: Begin eliminating unnecessary randomness in tests. 2016-10-09 01:11:14 +00:00
http HTTP API: Restore backwards compatibility with the `http_api_curl` filter - it expects that the handle parameter is passed as a reference, however [39212] missed that. 2017-02-17 05:06:23 +00:00
image Media: Allow PDF fallbacks filter to process custom sizes. 2016-12-21 05:52:54 +00:00
import Build/Test Tools: Utilise `assertWPError()` and `assertNotWPError()` in more places. 2016-11-09 00:01:42 +00:00
includes Tests: Reset post-related globals after each test. 2016-09-30 03:15:36 +00:00
l10n I18N: Add an additional caching layer for `_load_textdomain_just_in_time()`. 2016-11-21 16:06:38 +00:00
link Build/Test Tools: Begin eliminating unnecessary randomness in tests. 2016-10-09 01:11:14 +00:00
load
media Remove unnecessary uniqueness check in `get_attachment_taxonomies()`. 2016-08-30 03:06:06 +00:00
menu Docs: Fix phpdoc and jsdoc typos introduced in [38584] and [38587], respectively. 2016-09-11 18:45:59 +00:00
meta
multisite Build/Test Tools: Utilise `assertFileExists()` and `assertFileNotExists()` in more places. 2016-11-08 23:49:11 +00:00
oembed Build/Test Tools: Begin eliminating unnecessary randomness in tests. 2016-10-09 01:11:14 +00:00
option Options: Pass the `$passed_default` parameter to the `default_option_{$option}` filter in `add_option()`. 2016-11-30 21:31:38 +00:00
pomo
post Revert to pre-4.7 behavior for fetching object instances by id. 2017-01-26 16:56:21 +00:00
query Posts, Post Types: Ensure `is_page_template()` can only return true when viewing a singular post query. 2016-12-16 05:40:01 +00:00
rest-api REST API: Shim `post_date_gmt` for drafts / empty dates in the REST API. 2017-02-24 22:02:48 +00:00
rewrite Tests: Restore the database connection earlier when switching test groups. 2016-12-21 05:07:05 +00:00
taxonomy
term Revert to pre-4.7 behavior for fetching object instances by id. 2017-01-26 16:56:21 +00:00
theme Theme starter content: Add support for featured images and page templates. 2016-11-23 09:52:27 +00:00
user Build/Test Tools: Re-use a bunch of fixtures in test classes for user and XMLRPC tests. 2016-11-10 01:53:08 +00:00
xmlrpc Build/Test Tools: Re-use a bunch of fixtures in test classes for user and XMLRPC tests. 2016-11-10 01:53:08 +00:00
actions.php Build/Test Tools: Continue eliminating randomness in tests. 2016-10-09 01:29:04 +00:00
adminbar.php Build/Test Tools: Continue eliminating randomness in tests. 2016-10-26 01:23:24 +00:00
auth.php Security: Trigger a `_doing_it_wrong()` when `check_ajax_referer()` is called without its first parameter. This brings it inline with `check_admin_referer()`. 2016-08-28 17:14:52 +00:00
avatar.php
basic.php Build/Test Tools: Specify exact node version in package.json. 2016-12-04 17:37:38 +00:00
cache.php Build/Test Tools: Continue eliminating randomness in tests. 2016-10-09 01:29:04 +00:00
canonical.php
category.php
comment-submission.php Comments: Abstract `die()` calls from comment submission routine. 2016-10-11 03:42:28 +00:00
comment.php REST API: Fix test failures. 2016-10-20 05:12:26 +00:00
compat.php
cron.php Build/Test Tools: Continue eliminating randomness in tests. 2016-10-09 01:29:04 +00:00
db.php Tests: Restore the database connection earlier when switching test groups. 2016-12-21 05:07:05 +00:00
dbdelta.php Database: Normalise index names in `dbDelta()`. 2016-09-12 05:08:17 +00:00
dependencies.php
file.php Build/Test Tools: Begin eliminating unnecessary randomness in tests. 2016-10-09 01:11:14 +00:00
filters.php Plugins: Add a `current_priority()` method to `WP_Hook`. 2016-12-02 07:10:56 +00:00
functions.php Customize: Implement customized state persistence with changesets. 2016-10-18 20:04:36 +00:00
kses.php KSES: Deprecate `wp_kses_js_entities()`. 2016-10-13 22:24:27 +00:00
l10n.php I18N: In `wp_dropdown_languages()` rename the new `show_site_locale_default` argument to `show_option_site_default`. 2016-11-21 16:14:01 +00:00
link.php
locale.php I18N: Introduce a locale-switching function. 2016-10-26 15:35:58 +00:00
mail.php Mail: Set a better error code when triggering `wp_mail_failed`. 2016-11-02 04:26:18 +00:00
media.php Media: Avoid PHP Warnings in `get_post_galleries()` when processing empty `[gallery]` shortcodes and avoid returning the incorrect results when the global `$post` does not match the provided post ID. 2017-02-17 06:46:45 +00:00
meta.php Build/Test Tools: Begin eliminating unnecessary randomness in tests. 2016-10-09 01:11:14 +00:00
multisite.php
pluggable.php
post.php Build/Test Tools: Utilise `assertWPError()` and `assertNotWPError()` in more places. 2016-11-09 00:01:42 +00:00
query.php Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available. 2016-09-26 17:01:48 +00:00
rest-api.php REST API: Fix multiple issues with setting dates of posts and comments. 2017-02-24 21:58:07 +00:00
rewrite.php Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available. 2016-09-26 17:01:48 +00:00
shortcode.php Shortcodes: Add new `strip_shortcodes_tagnames` filter. 2016-10-23 14:24:26 +00:00
taxonomy.php Taxonomy: Disallow overriding the `name` property when registering a taxonomy. 2017-02-20 06:15:07 +00:00
template.php Posts, Post Types: Add support for post type templates. 2016-10-26 08:06:43 +00:00
term.php
theme.php Build/Test Tools: Utilise `assertFileExists()` and `assertFileNotExists()` in more places. 2016-11-08 23:49:11 +00:00
upload.php
url.php
user.php General: Restore usage of `$wpdb`, instead of `$this->db`. 2016-10-10 06:37:02 +00:00
walker.php
widgets.php
wp.php