Repository navigation
Tests: Fill navigation fallback REST read-side empty stubs - #13855
shail-mehta wants to merge 3 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
lancewillett
left a comment
There was a problem hiding this comment.
Please keep the OPTIONS assertions in test_context_param(), but leave test_get_items() as an annotated stub with a note that this controller has no collection operation.
The real route is the singleton /wp-block-editor/v1/navigation-fallback. Adding an s creates an unrelated, unregistered URL; its 404 does not exercise the navigation fallback controller. The ticket guidance allows documenting this unsupported operation.
The patch passes locally and CI is green; this request concerns the usefulness of the collection check.
Adversarial review · gpt-6
|
I have applied changes in latest commit. |
Verify that OPTIONS exposes no context argument for the navigation fallback endpoint. Document that the controller has no collection operation. Developed in: #13855 Props shailu25. See #40538. git-svn-id: https://develop.svn.wordpress.org/trunk@64021 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #13855 landed in https://core.trac.wordpress.org/changeset/64021 |
Verify that OPTIONS exposes no context argument for the navigation fallback endpoint. Document that the controller has no collection operation. Developed in: WordPress/wordpress-develop#13855 Props shailu25. See #40538. Built from https://develop.svn.wordpress.org/trunk@64021 git-svn-id: http://core.svn.wordpress.org/trunk@63181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: #40538
What
Replaces the empty
@doesNotPerformAssertionsstubs fortest_context_param()andtest_get_items()in the navigation fallback REST API tests with real assertions.Why
Per #40538, remaining read-side empty stubs should become real assertions.
rest-navigation-fallback-controller.phphas two claimable read-side cases. Write-side andprepare_itemstubs are left alone pending #66073.How
In
WP_REST_Navigation_Fallback_Controller_Test:test_context_param()—OPTIONS/wp-block-editor/v1/navigation-fallbackand assert nocontextargtest_get_items()—GET/wp-block-editor/v1/navigation-fallbacksand assertrest_no_route/404(no collection route)Testing instructions
node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpunit --filter 'WP_REST_Navigation_Fallback_Controller_Test::test_context_param|WP_REST_Navigation_Fallback_Controller_Test::test_get_items'Use of AI Tools