-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add http client from Symfony to meilisearch factory if present #5
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
feat: add http client from Symfony to meilisearch factory if present #5
Conversation
0ac6aa9
to
8fb8871
Compare
Not sure why the tests are failing. I haven't touched them yet. 🤔 |
0735606
to
c9c09d4
Compare
Thanks again for your contribution ! However, adding this to the http_client configuration bothers me a bit, as this option will only be applicable to Meilisearch. |
Hey @AlexandrePetrone, I was inspired by how the official Meilisearch bundle handles this (ref: meilisearch/meilisearch-symfony#359). Speaking of the configuration, I also think the place is not ideal and share your sentiment. Let's inject the client directly and make it configurable in the future (if needed). WDYT? |
c9c09d4
to
2768c2a
Compare
Changes done. Testing this is almost impossible as the created Meilisearch client does not expose any properties which can be asserted. However, creating a client in a test with the passed argument should be enough if it doesn't result in an exception. 😅 |
2768c2a
to
bf748fa
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.
Thank you, @daFish . After this last point, I suggest merging. For tests in Symfony 7.3-dev, we should handle that in another PR, as it's not related to this change.
Should be fixed upstream by symfony/symfony#60001. |
bf748fa
to
5d48716
Compare
This change adds a new configuration to specify an HTTP client from the container if present. This helps mocking requests in tests.
Bonus point: the initial request is also shown in the web debug toolbar.