-
Notifications
You must be signed in to change notification settings - Fork 17
Add Client::getLastRequest #23
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
Conversation
217c8c6
to
8639021
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the getLastRequest method. the others seem odd - they would return things that we set with addResponse or addException. i don't think we should have those methods. or is there a good use case for them?
Well, not for me personally. Maybe @sagikazarmark cans explain it? |
I would like to....... 😝 Jokes aside: I can't recall the exact use case for those two (maybe I could have written a better issue description). I can think of a case when you configure the MockClient outside of your test case (with some common input) and you can't access that input directly. In those cases these methods could be useful, not sure how valid this case is. |
Maybe as a Symfony service for example? php-http/HttplugBundle#212 |
8639021
to
14226e5
Compare
Conflicts resolved. |
Hm, maybe. Can't decide whether it's good or bad, but I can't see any issues with having them. @dbu ? |
i find them confusing because i don't see legit use cases for it. they can be added when somebody has an actual use case for them imho. but i can life with them if you insist on having them ;-) |
Do you still think this is useful? Or should we just drop this (BTW sorry @soullivaneuh ) |
getlastrequest sounds more useful to me. you can check what the last request that has been sent contained, and make assertions on it and so on. |
So do you want me to let only
Don't worry, not a big deal! 😉 |
14226e5
to
cafad97
Compare
I updated this PR. Well, it looks @Nyholm merge the docs one too quickly, here is a correction: php-http/documentation#216 |
sorry, this went under... @soullivaneuh would you mind checking if the doc is now correct on this one as its merged? |
@dbu The doc is good according to me. Could we have a new release since all the PR are merged? :-) |
I've reviewed the changes. I think it's alright to tag 1.1.0. I have not been a part of the latest PRs so I leave it to other maintainer to do the tag. |
What's in this PR?
Add getters for last response, exception and request.
Why?
Because @sagikazarmark asked for it. 😉
Example Usage
See the doc PR
Checklist