diff --git a/tests/smoke.php b/tests/smoke.php index b25a339..05d18bb 100644 --- a/tests/smoke.php +++ b/tests/smoke.php @@ -211,6 +211,18 @@ $ours = array_filter( ); wc_edm_ok( 'the REST routes are registered', count( $ours ) > 0, 'namespace ' . WC_EDM_REST_API::REST_NAMESPACE ); +// The namespace spelled out, NOT compared to the constant it came from. The +// filter above derives what it looks for from REST_NAMESPACE, so it agrees +// with itself whatever that constant says: rename it and the routes are still +// "registered", while every caller that already integrated against +// wc-edm/v1 gets a 404 and nothing here goes red. This is the one string in +// the plugin that somebody else's code depends on by name. +wc_edm_is( + 'and under the namespace callers already integrated against', + 'wc-edm/v1', + WC_EDM_REST_API::REST_NAMESPACE +); + $request = new WP_REST_Request( 'GET', '/' . WC_EDM_REST_API::REST_NAMESPACE . '/groups' ); $response = rest_get_server()->dispatch( $request ); wc_edm_is( 'and they refuse an unauthenticated caller', 401, $response->get_status() );