Skip to content

Commit 671f98c

Browse files
authored
Update symfony-bundle.rst
1 parent 2ba5599 commit 671f98c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

integrations/symfony-bundle.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,13 @@ Then, use the mock client factory in your test environment configuration:
518518
# config_test.yml
519519
httplug:
520520
clients:
521-
my_awesome_client:
521+
my_awesome_backend:
522522
factory: 'httplug.factory.mock' # replace factory
523523
524+
The client is always wrapped into a plugin client. Therefore you need to access
525+
the inner client, which has `.client` appended. For the example above, the full
526+
name is `httplug.clients.my_awesome_backend.client`.
527+
524528
To mock a response in your tests, do:
525529

526530
.. code-block:: php
@@ -533,7 +537,7 @@ To mock a response in your tests, do:
533537
534538
$response = $this->createMock('Psr\Http\Message\ResponseInterface');
535539
$response->method('getBody')->willReturn(/* Psr\Http\Message\Interface instance containing expected response content. */);
536-
$client->getContainer()->get('httplug.client.mock')->addResponse($response);
540+
$client->getContainer()->get('httplug.clients.my_awesome_backend.client')->addResponse($response);
537541
538542
Read more on how the mock client works in the :doc:`mock client documentation </clients/mock-client>`.
539543

0 commit comments

Comments
 (0)