httpmockserver
|
HTTP mock server allows you to test HTTP clients easily.
Basic information, such as requirements and installation steps, can be found at Readme.md file.
To create a simple test, you need to follow these steps:
Method httpmock::MockServer::responseHandler() is responsible for request handling. Request arguments are passed as method arguments, which contains request path, method type, headers, POST data and URL arguments.
After processing request, the httpmock::MockServer::Response has to be returned. It contains response body and status.
Custom headers can be added into the response object using httpmock::MockServer::Response::addHeader() method, passing key-value httpmock::MockServer::Header object instances.