mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Site Health, REST API: Move async tests to REST API endpoints.
This provides more flexibility when writing tests and benefits from running in a front-end context which is necessary for some tests like checking that updates are supported. Additionally, this provides a more robust interface for developers who want to integrate with Site Health tests. Because the `wp/v2` endpoint is reserved for modeling core entities, site health is registered in its own `wp-site-health/v1` namespace. The existing ajax actions have been maintained for backward compatibility. Props Clorith, chrisvanpatten, afragen, pokhriyal, TimothyBlynJacobs. Fixes #48105. git-svn-id: https://develop.svn.wordpress.org/trunk@49154 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -132,6 +132,11 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
|
||||
'/wp/v2/plugins',
|
||||
'/wp/v2/plugins/(?P<plugin>[^.\/]+(?:\/[^.\/]+)?)',
|
||||
'/wp/v2/block-directory/search',
|
||||
'/wp-site-health/v1',
|
||||
'/wp-site-health/v1/tests/background-updates',
|
||||
'/wp-site-health/v1/tests/loopback-requests',
|
||||
'/wp-site-health/v1/tests/dotorg-communication',
|
||||
'/wp-site-health/v1/directory-sizes',
|
||||
);
|
||||
|
||||
$this->assertSameSets( $expected_routes, $routes );
|
||||
@@ -141,7 +146,8 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
|
||||
return (
|
||||
'/' === $route ||
|
||||
preg_match( '#^/oembed/1\.0(/.+)?$#', $route ) ||
|
||||
preg_match( '#^/wp/v2(/.+)?$#', $route )
|
||||
preg_match( '#^/wp/v2(/.+)?$#', $route ) ||
|
||||
preg_match( '#^/wp-site-health/v1(/.+)?$#', $route )
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user