Opened 2 months ago
Last modified 7 weeks ago
#59390 new defect (bug)
Incorrect method / function args used in bin/tests/core/tests/rest-api/wpRestMenuItemsController.php
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Menus | Keywords: | has-patch changes-requested |
Focuses: | rest-api | Cc: |
Description
The Tests_REST_WpRestMenuItemsController::check_get_menu_item_response
method accepts 2 arguments, however 3 are passed to the method in https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/rest-api/wpRestMenuItemsController.php?rev=56549#L885
It feels like the Tests_REST_WpRestMenuItemsController::check_menu_item_data
method was meant to be used here.
Attachments (1)
Change History (10)
#1
@
2 months ago
- Component changed from General to Menus
- Focuses rest-api added
- Milestone changed from Awaiting Review to 6.4
- Version set to 5.9
#2
@
2 months ago
- Keywords has-patch added
@SergeyBiryukov, you beat me to it! I was just about to add the ticket and changeset entry for when it was introduced. 😅
#3
@
2 months ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://core.trac.wordpress.org/attachment/ticket/59390/59390.diff
Environment
- OS: macOS 13.4.1
- PHP: 8.2.11
- WordPress: trunk
Actual Results
- ✅ Issue resolved with patch.
Additional Notes
- PHPUnit tests continue to pass after applying the patch.
#4
@
8 weeks ago
With just over a week left until 6.4 RC1, do we think this ticket will make it? I submitted a passing test report last week – do we think this ticket is ready for commit?
This ticket was mentioned in Slack in #core by oglekler. View the logs.
7 weeks ago
#6
@
7 weeks ago
@audrasjb you are this component maintainer, please take a look, it should be ready for commit.
#7
@
7 weeks ago
- Keywords changes-requested added
Thanks for the patch!
I'm a bit confused here. The Tests_REST_WpRestMenuItemsController::check_menu_item_data()
method requires four arguments, so unless I'm missing something, passing only three would cause a fatal error, and the test only passes accidentally because that branch is never hit.
This could use some more investigation.
#8
@
7 weeks ago
I think you're absolutely right @SergeyBiryukov.
@davidbinda could you take a look at https://core.trac.wordpress.org/ticket/59390#comment:7?
@audrasjb pinging you as well as the component maintainer to see if you have any input on this.
Good catch, introduced in [52079] / #40878.