From a5c72c13a3bb812d5cb49b9bd74bc9e75c250d17 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 27 Mar 2018 08:34:51 +0200 Subject: [PATCH 1/2] Added info about the "service" key for the bundle --- integrations/symfony-bundle.rst | 14 +++++++++++++- integrations/symfony-full-configuration.rst | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/integrations/symfony-bundle.rst b/integrations/symfony-bundle.rst index 807283b..fc1d29a 100644 --- a/integrations/symfony-bundle.rst +++ b/integrations/symfony-bundle.rst @@ -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 ``````` @@ -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); diff --git a/integrations/symfony-full-configuration.rst b/integrations/symfony-full-configuration.rst index e9f4640..5d85260 100644 --- a/integrations/symfony-full-configuration.rst +++ b/integrations/symfony-full-configuration.rst @@ -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: From 7092803b1a2ef13bf931ce5836963b6ea81a9954 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 27 Mar 2018 09:04:24 +0200 Subject: [PATCH 2/2] Added "versionadded" --- integrations/symfony-bundle.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/integrations/symfony-bundle.rst b/integrations/symfony-bundle.rst index fc1d29a..02197c2 100644 --- a/integrations/symfony-bundle.rst +++ b/integrations/symfony-bundle.rst @@ -209,15 +209,17 @@ services are: .. note:: - If you already have a client service registered you can skip using the ``factory`` - and use the ``service`` key instead. + .. versionadded:: 1.10 - .. code-block:: yaml + If you already have a client service registered you can skip using the ``factory`` + and use the ``service`` key instead. - httplug: - clients: - my_client: - service: 'my_custom_client_service' + .. code-block:: yaml + + httplug: + clients: + my_client: + service: 'my_custom_client_service' Plugins ```````