Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,18 @@ services are:
* ``httplug.factory.socket``
* ``httplug.factory.mock`` (Install ``php-http/mock-client`` first)

.. note::

If you already have a client service registered you can skip using the ``factory``
and use the ``service`` key instead.

.. code-block:: yaml

httplug:
clients:
my_client:
service: 'my_custom_client_service'

Plugins
```````

Expand Down Expand Up @@ -366,7 +378,7 @@ To mock a response in your tests, do:

// If your test has the client (BrowserKit) make multiple requests, you need to disable reboot as the kernel is rebooted on each request.
// $client->disableReboot();

$response = $this->createMock('Psr\Http\Message\ResponseInterface');
$response->method('getBody')->willReturn(/* Psr\Http\Message\Interface instance containing expected response content. */);
$client->getContainer()->get('httplug.client.mock')->addResponse($response);
Expand Down
1 change: 1 addition & 0 deletions integrations/symfony-full-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ This page shows an example of all configuration values provided by the bundle.
clients:
acme:
factory: 'httplug.factory.guzzle6'
service: 'my_service' # Can not be used with "factory" or "config"
flexible_client: false # Can only be true if http_methods_client is false
http_methods_client: false # Can only be true if flexible_client is false
config:
Expand Down