Skip to content

Commit 12ebc34

Browse files
committed
Tests: Add content-types REST routes to schema test
Updates the expected routes list in the REST schema test to include the new /wp/v2/content-types endpoints.
1 parent 2da421e commit 12ebc34

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

tests/phpunit/tests/rest-api/rest-schema-setup.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ public function test_expected_routes_in_schema() {
133133
'/wp/v2/users/(?P<user_id>(?:[\\d]+|me))/application-passwords/(?P<uuid>[\\w\\-]+)',
134134
'/wp/v2/comments',
135135
'/wp/v2/comments/(?P<id>[\\d]+)',
136+
'/wp/v2/content-types',
137+
'/wp/v2/content-types/(?P<content_type>[a-z0-9_-]+)',
136138
'/wp/v2/global-styles/(?P<id>[\/\d+]+)',
137139
'/wp/v2/global-styles/(?P<parent>[\d]+)/revisions',
138140
'/wp/v2/global-styles/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)',

tests/qunit/fixtures/wp-api-generated.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,47 @@ mockedApiResponse.Schema = {
260260
"self": "http://example.org/index.php?rest_route=/wp/v2"
261261
}
262262
},
263+
"/wp/v2/content-types": {
264+
"namespace": "wp/v2",
265+
"methods": [
266+
"GET"
267+
],
268+
"endpoints": [
269+
{
270+
"methods": [
271+
"GET"
272+
],
273+
"args": []
274+
}
275+
],
276+
"_links": {
277+
"self": [
278+
{
279+
"href": "http://example.org/index.php?rest_route=/wp/v2/content-types"
280+
}
281+
]
282+
}
283+
},
284+
"/wp/v2/content-types/(?P<content_type>[a-z0-9_-]+)": {
285+
"namespace": "wp/v2",
286+
"methods": [
287+
"GET"
288+
],
289+
"endpoints": [
290+
{
291+
"methods": [
292+
"GET"
293+
],
294+
"args": {
295+
"content_type": {
296+
"description": "Content type identifier.",
297+
"type": "string",
298+
"required": true
299+
}
300+
}
301+
}
302+
]
303+
},
263304
"/wp/v2/posts": {
264305
"namespace": "wp/v2",
265306
"methods": [

0 commit comments

Comments
 (0)