Tests: Fill global styles REST read-side empty stubs. - #13854
shail-mehta wants to merge 2 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.
The OPTIONS checks in test_context_param() exercise registered endpoints and look useful. Please keep those and restore the documented stub for test_get_items().
There is no collection operation here. Checking that its unregistered URL returns 404 tests the router fallback, rather than a global-styles read operation. The ticket guidance permits documenting unsupported operations.
The patch passes locally and CI is green. This should be ready for another look once that scope is trimmed.
Adversarial review · gpt-6
|
Applied changes in latest commit. |
Use OPTIONS requests to verify that the single global styles and theme global styles endpoints omit the context argument. Developed in: #13854 Props shailu25. See #40538. git-svn-id: https://develop.svn.wordpress.org/trunk@64020 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #13854 landed in https://core.trac.wordpress.org/changeset/64020 |
Use OPTIONS requests to verify that the single global styles and theme global styles endpoints omit the context argument. Developed in: WordPress/wordpress-develop#13854 Props shailu25. See #40538. Built from https://develop.svn.wordpress.org/trunk@64020 git-svn-id: http://core.svn.wordpress.org/trunk@63180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: https://core.trac.wordpress.org/ticket/40538
What
Replaces the empty
@doesNotPerformAssertionsstubs fortest_context_param()andtest_get_items()in the global styles REST API tests with real assertions.Why
Per #40538, remaining read-side empty stubs should become real assertions.
rest-global-styles-controller.phphas two claimable read-side cases. Write-side andprepare_itemstubs are left alone pending #66073.How
In
WP_REST_Global_Styles_Controller_Test:test_context_param()—OPTIONSon single and theme global styles routes; assert nocontextargtest_get_items()—GET/wp/v2/global-stylesand 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_Global_Styles_Controller_Test::test_context_param|WP_REST_Global_Styles_Controller_Test::test_get_items'Use of AI Tools