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 Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
commentsTemplate.php Ignore hierarchy in pagination calculation when comment threading is disabled. 2016-01-13 03:12:34 +00:00
dateQuery.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
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 Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
getCommentCount.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
getCommentExcerpt.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
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 Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
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 Unit Tests: Change some @group annotations to @ticket. 2016-07-04 20:24:52 +00:00
query.php Comments: Don't do direct SQL query when fetching decendants. 2016-08-30 14:48:00 +00:00
slashes.php Unit Tests: WP_UnitTest_Generator_Sequence needs a static incrementer - otherwise, it assumes every test class is a reset, which it no longer is (it is now static). 2015-10-17 19:24:20 +00:00
template.php Unit Tests: Add description for data_get_comments_number_text_declension(). 2016-07-07 10:44:57 +00:00
walker.php Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
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 Unit Tests: after [35225], make factory a method/getter on WP_UnitTestCase and add magic methods for BC for every plugin that is extending WP_UnitTestCase and accessing the $factory instance prop. 2015-10-17 18:02:16 +00:00
wpListComments.php Comments: In wp_list_comments(), queries with custom pagination params should obey default comment_status logic. 2016-06-08 04:00:18 +00:00
wpUpdateCommentCountNow.php Correct usage of Covers for Tests_Update_Comment_Count_Now 2016-05-17 20:19:50 +00:00