Skip to content

Commit

Permalink
Added info about the "service" key for the bundle (#230)
Browse files Browse the repository at this point in the history
* Added info about the "service" key for the bundle

* Added "versionadded"
  • Loading branch information
Nyholm committed Mar 27, 2018
1 parent 30e5809 commit 2d6cab3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,20 @@ services are:
* ``httplug.factory.socket``
* ``httplug.factory.mock`` (Install ``php-http/mock-client`` first)

.. note::

.. versionadded:: 1.10

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 +380,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

0 comments on commit 2d6cab3

Please sign in to comment.