Repository navigation
Tests: Assert unsupported requests for edit site export controller - #14115
shail-mehta wants to merge 3 commits into
Conversation
b011775 to
3355baf
Compare
|
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. |
|
Optional follow-up, not required before landing: alongside the OPTIONS status assertions, assert AI review · |
|
PR #14115 landed in https://core.trac.wordpress.org/changeset/64275 |
Replace empty REST test stubs with assertions that item paths and write methods return `rest_no_route` for the site export controller. Developed in: #14115 Props shailu25. See #66073. git-svn-id: https://develop.svn.wordpress.org/trunk@64275 602fd350-edb4-49c9-b593-d223f7449a82
Replace empty REST test stubs with assertions that item paths and write methods return `rest_no_route` for the site export controller. Developed in: WordPress/wordpress-develop#14115 Props shailu25. See #66073. Built from https://develop.svn.wordpress.org/trunk@64275 git-svn-id: http://core.svn.wordpress.org/trunk@63425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Part of: #66073
What
Replaces empty
@doesNotPerformAssertionsget/create/update/delete stubs inTests_REST_WpRestEditSiteExportControllerwith real negative assertions.Each unsupported request asserts
rest_no_routewith status404, using an authenticated administrator.Updated file:
tests/phpunit/tests/rest-api/wpRestEditSiteExportController.phpWhy
The edit site export controller only registers
GET /wp-block-editor/v1/export. Empty abstract-method stubs hide whether unsupported operations are actually rejected, and the annotation count keeps growing.This continues the agreed approach from [64004] / [64075] / [64076] on another conventional read-only controller, before any broader
WP_Test_REST_Controller_Testcasechange.How
GET /wp-block-editor/v1/export/example→rest_no_route/404(no item route)POST /wp-block-editor/v1/export→rest_no_route/404(route is GET-only)POST/PUT/PATCH/wp-block-editor/v1/export→rest_no_route/404(asserts OPTIONS 200 first so the path is proven valid)DELETE /wp-block-editor/v1/export→rest_no_route/404(asserts OPTIONS 200 first)test_get_items()annotated (export GET is not a collection list operation)prepare_item()/get_item_schema()unchanged (held for further discussion)Testing instructions
npm run test:php -- --filter Tests_REST_WpRestEditSiteExportControllerUse of AI tools
Cursor