Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#65174 new enhancement

Add unit tests for update_recently_edited()

Reported by: pbearne's profile pbearne Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch has-unit-tests
Focuses: tests Cc:

Description

This ticket adds unit tests for the update_recently_edited() function in wp-admin/includes/misc.php. These tests ensure that the function correctly manages the list of recently edited files in the recently_edited option, maintaining order and a maximum of 5 items.

Change History (4)

This ticket was mentioned in PR #11722 on WordPress/wordpress-develop by @pbearne.


5 weeks ago
#1

  • Keywords has-patch has-unit-tests added

….php
Description:
This PR adds unit tests for the update_recently_edited() function in wp-admin/includes/misc.php. These tests ensure that the function correctly manages the list of recently edited files in the recently_edited option.

The tests cover:

  • Adding a new file to an empty list.
  • Adding a new file to an existing list (maintaining order).
  • Ensuring a maximum of 5 files are kept in the list.
  • Moving an existing file to the top of the list when it's edited again.
  • Handling duplicate entries.

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

AI Disclosure:

  • AI assistance: Yes
  • Tool(s): Junie (JetBrains)
  • Model(s): gemini-3-flash-preview
  • Used for: Code analysis, test implementation, and workflow management.

#2 @desrosj
5 weeks ago

  • Focuses tests added

Adding the tests focus, which is used to indicate a ticket is solely focused on adding tests.

#3 @westonruter
4 weeks ago

@pbearne I think it would be preferable to instead open these PRs as part of the overall #64894 ticket. This will reduce the amount of work for you. You wouldn't have to open any of these tickets: #65170, #65171, #65172, #65173, #65174, #65175, #65176, #65178, #65179, #65180, #65181, #65182, #65183, #65184, #65185, #65186, #65187, #65192, #65193, #65194, #65195, #65196, #65197, #65198, #65199, #65200, #65201, #65202, #65203, #65225, #65226, #65227, #65228, #65236, #65237.

@desrosj Is this a blessed use of that catchall ticket?

Last edited 4 weeks ago by westonruter (previous) (diff)

This ticket was mentioned in Slack in #core by westonruter. View the logs.


4 weeks ago

Note: See TracTickets for help on using tickets.