-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Issues with HttpPlug mock client #101
Comments
Hey @KDederichs! What about |
Nope also doesn't do it. I put in some logging at different places in the code (Mock Client) and so far the the |
It seems to work if I directly do that in the constructor of the browser/src/Browser/KernelBrowser.php Line 33 in ea84ec6 If you call So I'd say that's the client I need but apparently not the one I seem to get. |
Ok found it: Turns out Might be good to place that a bit more prominent in the docs (cause I didn't see it till explicitly looking for if it's mentionen) |
Ah ok, glad you got it sorted. This is the same behavior of
Where in the docs do you think this should be mentioned? Would you be up to making a PR? |
Could |
I don't think disabling reboot does anything tbh since each Like I said it's not an issue IF you know it does it. But the fact that it does boot up a new browser every time is not obvious at first glance and you're inclined to just use I'll look into where one might put it in the docs soon, maybe as comment or text in/above the first examples would do alreayd. Just something to make people aware of it from the get go. |
Ah, right ok, |
shouldn't we provide a |
beside of this, do we really need to call
I quite agree with this statement, at first glance, it could be really confusing this kind of code does not work: self::getContainer()->set('http.client', new MockHttpClient());
$this->browser()->doSomeStuffWithMockclient(); |
This feels out of scope of this package to me. https://github.com/Happyr/service-mocking is the solution imo.
Related issue: symfony/symfony#49930 |
We do when using |
Thanks to pointing this issue. This would actually be the silver bullet for this problem Nevertheless, I'm still questioning the fact that we actually always reset the kernel before even the first request. As soon as we call |
Hey,
I'm having issues with the HttpPlug Mock client:
https://docs.php-http.org/en/latest/integrations/symfony-bundle.html#usage-for-reusable-bundles
I can't seem to set request matches, the
conditionalResults
in the Mock client is always empty.I tried setting it using:
self::getContainer()
and
$this->browser()->getContainer()
but both seem to be the wrong ones.
Anyone know the right container the request is made against?
The text was updated successfully, but these errors were encountered: