wordpress-develop/tests/phpunit/tests/comment
Rachel Baker ea3b41d8e3 Feeds: Always return a valid timestamp for the Last-Modified header of comment or post feeds.
Fixes bug where an invalid Last-Modified value would be returned in feed requests for sites that had 0 items to return. Comment or post feeds will now return the current timestamp as the Last-Modified header value.  Example: a request for the comments feed for a site without any comments.

Replaced use of the local static variable `$cache_lastcommentmodified` to store the modified date in `get_lastcommentmodified()` with the Object Cache API.  The `get_lastcommentmodified()` function returns early if there is a cached value and returns `false` if there where no comments found. Introduced `_clear_modified_cache_on_transition_comment_status()` to flush the `lastcommentmodified` cache key when a comment enters or leaves approval status. In `get_lastpostmodified()` return early if there is a cached value and return `false` if there are no posts found.

Props swissspidy, rachelbaker, dllh, leobaiano.
Fixes #38027.

git-svn-id: https://develop.svn.wordpress.org/trunk@38925 602fd350-edb4-49c9-b593-d223f7449a82
2016-10-25 20:47:06 +00:00
..
checkComment.php Comments: Improve check for previous comments for authenticated users in check_comment(). 2016-10-06 15:50:55 +00:00
commentForm.php
commentsTemplate.php
dateQuery.php
getCommentAuthorEmailLink.php Build/Test Tools: Continue eliminating randomness in tests. 2016-10-09 01:29:04 +00:00
getCommentAuthorUrlLink.php Unit Tests: 2016-08-27 08:35:16 +00:00
getCommentClass.php
getCommentCount.php
getCommentExcerpt.php
getCommentLink.php Unit Tests: 2016-08-27 08:35:16 +00:00
getCommentReplyLink.php Set default value of 'max_depth' in get_comment_reply_link(). 2016-09-28 04:19:46 +00:00
getCommentsPagesCount.php
getPageOfComment.php Comments: Account for the comment_order option in get_page_of_comment(). 2016-10-06 17:41:51 +00:00
lastCommentModified.php Feeds: Always return a valid timestamp for the Last-Modified header of comment or post feeds. 2016-10-25 20:47:06 +00:00
metaCache.php
query.php Comments: Don't do direct SQL query when fetching decendants. 2016-08-30 14:48:00 +00:00
slashes.php
template.php Unit Tests: Add description for data_get_comments_number_text_declension(). 2016-07-07 10:44:57 +00:00
walker.php
wpAllowComment.php REST API: Fix comment option leak causing another test failure. 2016-10-20 05:24:39 +00:00
wpBlacklistCheck.php Comments: Include comment_content with html and without in blacklist_keys comparison. 2016-07-13 14:04:10 +00:00
wpComment.php Unit Tests: 2016-08-27 08:35:16 +00:00
wpCountComments.php
wpListComments.php
wpUpdateCommentCountNow.php