Skip to content

Tests: Cover delete_get_calendar_cache() - #15318

Closed
devmuhib009 wants to merge 1 commit into
WordPress:trunkfrom
devmuhib009:tests/65819-cover-delete-get-calendar-cache
Closed

devmuhib009 wants to merge 1 commit into
WordPress:trunkfrom
devmuhib009:tests/65819-cover-delete-get-calendar-cache

Conversation

@devmuhib009

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/65819

This PR adds unit tests for delete_get_calendar_cache() covering:

  • Deleting the 'get_calendar' cache entry in the 'calendar' cache group
  • Executing safely when the cache entry is already empty

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props devmuhib.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the added calendar-cache deletion tests.

No open issues 🎉

What changed in this PR

Adds unit tests for delete_get_calendar_cache() in WordPress’s general test suite, supporting Trac ticket #65819. No production code changes are included.

Changes:

  • Verifies deletion of the get_calendar entry from the calendar cache group.
  • Verifies the function executes safely when the cache entry is already absent.
File Description
tests/​phpunit/​tests/​general/​deleteGetCalendarCache.php Adds tests for populated and missing calendar cache entries.

Review effort: Balanced

@huzaifaalmesbah huzaifaalmesbah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few small notes inline.

AI Review: Opus 5.5

*
* @ticket 65819
*/
public function test_delete_get_calendar_cache_when_empty() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: this test still passes if delete_get_calendar_cache() is empty, since the setup already leaves the cache clear. Feel free to drop it and keep the first test, which does fail in that case.

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed code against the implementation and existing coverage; no blocking issue found.

Validated with the related behavioral coverage patches on current trunk: 35 tests / 43 assertions in each of single-site and multisite, randomized seed 1101. No failures, errors, warnings, or skips.

Current-head CI and Copilot review checked.

AI review · gpt-6

wporg-sync pushed a commit that referenced this pull request Nov 1, 2026
Cover XML date and weekday display with fixed dates. Extend weekday-date assertions for repeated output and filters, and verify `delete_get_calendar_cache()` targets the calendar cache entry.

Developed in: #15238, #15239, #15318

Props devmuhib, huzaifaalmesbah.
See #65819.


git-svn-id: https://develop.svn.wordpress.org/trunk@65170 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 1, 2026
Cover XML date and weekday display with fixed dates. Extend weekday-date assertions for repeated output and filters, and verify `delete_get_calendar_cache()` targets the calendar cache entry.

Developed in: WordPress/wordpress-develop#15238, WordPress/wordpress-develop#15239, WordPress/wordpress-develop#15318

Props devmuhib, huzaifaalmesbah.
See #65819.

Built from https://develop.svn.wordpress.org/trunk@65170


git-svn-id: http://core.svn.wordpress.org/trunk@64319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@lancewillett

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants