Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Oct 19, 2020
1 parent 12f4d57 commit 18dba4e
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/wp-includes/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ function create_initial_rest_routes() {
// Site Health
$site_health = WP_Site_Health::get_instance();
$controller = new WP_REST_Site_Health_Controller( $site_health );
$controller->register_routes();

// Sidebars.
$controller = new WP_REST_Sidebars_Controller();
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ function _unhook_block_registration() {
remove_action( 'init', 'register_block_core_categories' );
remove_action( 'init', 'register_block_core_latest_comments' );
remove_action( 'init', 'register_block_core_latest_posts' );
remove_action( 'init', 'register_block_core_legacy_widget' );
remove_action( 'init', 'register_block_core_rss' );
remove_action( 'init', 'register_block_core_search' );
remove_action( 'init', 'register_block_core_shortcode' );
Expand Down
207 changes: 206 additions & 1 deletion tests/qunit/fixtures/wp-api-generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ mockedApiResponse.Schema = {
"namespaces": [
"oembed/1.0",
"wp/v2",
"wp-site-health/v1"
"wp-site-health/v1",
"__experimental"
],
"authentication": [],
"routes": {
Expand Down Expand Up @@ -5173,6 +5174,210 @@ mockedApiResponse.Schema = {
}
]
}
},
"/__experimental": {
"namespace": "__experimental",
"methods": [
"GET"
],
"endpoints": [
{
"methods": [
"GET"
],
"args": {
"namespace": {
"required": false,
"default": "__experimental"
},
"context": {
"required": false,
"default": "view"
}
}
}
],
"_links": {
"self": [
{
"href": "http://example.org/index.php?rest_route=/__experimental"
}
]
}
},
"/__experimental/sidebars": {
"namespace": "__experimental",
"methods": [
"GET"
],
"endpoints": [
{
"methods": [
"GET"
],
"args": []
}
],
"_links": {
"self": [
{
"href": "http://example.org/index.php?rest_route=/__experimental/sidebars"
}
]
}
},
"/__experimental/sidebars/(?P<id>[\\w-]+)": {
"namespace": "__experimental",
"methods": [
"GET",
"POST",
"PUT",
"PATCH"
],
"endpoints": [
{
"methods": [
"GET"
],
"args": {
"id": {
"required": false,
"description": "The id of a registered sidebar",
"type": "string"
}
}
},
{
"methods": [
"POST",
"PUT",
"PATCH"
],
"args": {
"widgets": {
"required": false,
"description": "Nested widgets.",
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Unique identifier for the widget.",
"type": "string",
"context": [
"view",
"edit",
"embed"
]
},
"id_base": {
"description": "Type of widget for the object.",
"type": "string",
"context": [
"view",
"edit",
"embed"
]
},
"widget_class": {
"description": "Class name of the widget implementation.",
"type": "string",
"context": [
"view",
"edit",
"embed"
]
},
"name": {
"description": "Name of the widget.",
"type": "string",
"context": [
"view",
"edit",
"embed"
]
},
"description": {
"description": "Description of the widget.",
"type": "string",
"context": [
"view",
"edit",
"embed"
]
},
"number": {
"description": "Number of the widget.",
"type": "integer",
"context": [
"view",
"edit",
"embed"
]
},
"rendered": {
"description": "HTML representation of the widget.",
"type": "string",
"context": [
"view",
"embed"
],
"readonly": true
},
"rendered_form": {
"description": "HTML representation of the widget admin form.",
"type": "string",
"context": [
"edit"
],
"readonly": true
},
"settings": {
"description": "Settings of the widget.",
"type": "object",
"context": [
"view",
"edit",
"embed"
],
"default": []
}
}
}
}
}
}
]
},
"/__experimental/widget-utils/form/(?P<widget_class>[^/]*)": {
"namespace": "__experimental",
"methods": [
"POST",
"PUT",
"PATCH"
],
"endpoints": [
{
"methods": [
"POST",
"PUT",
"PATCH"
],
"args": {
"widget_class": {
"required": true,
"description": "Class name of the widget.",
"type": "string"
},
"instance": {
"required": false,
"default": [],
"description": "Current widget instance",
"type": "object"
}
}
}
]
}
}
};
Expand Down

0 comments on commit 18dba4e

Please sign in to comment.