Rest API in integration tests – filtering by slug not working?

to add parameters when you use WP_REST_Request, you have to do that :

$request = new WP_REST_Request('GET', "/wp/v2/pages");

$request->set_query_params([
    "slug" => $this->api_docs_page_id,
]);