-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checking request query string? #30
Comments
Generally you can do anything by passing a matching callback. See this example: $this->http->mock
->when()
->callback(
function (Request $request) {
return $request->query->has('key1');
}
)
->methodIs('GET')
->then()
->body('query string')
->end();
$this->http->setUp(); But you are right, we should have a convenient API to do so. Let me think about it. |
Awesome! Thank you - I missed the callback functionality. |
Was hard to find without reading the code so far. I finally got around adding some documentation. Have a look here, maybe you can find some more gems: https://github.com/InterNations/http-mock/blob/master/doc/index.md |
Have a look at #31! Feedback welcome |
Merged #31 |
Is there a way to check the query string of a request (particularly for GET requests)? I want to make sure a transformation in my request wrapper actually occurs when I make the request.
If this isn't yet possible, here's the API I would expect:
or
PS: Thank you for making this library. It's nice to be able to mock HTTP requests in my test suite.
The text was updated successfully, but these errors were encountered: