Skip to content

Commit

Permalink
Merge branch 'GaryPEGEOT-feature/vcr-integration'
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed May 29, 2019
2 parents 4630d19 + f79e62a commit b9bc9e0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
25 changes: 25 additions & 0 deletions integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,31 @@ You can configure a client with authentication. Valid authentication types are
Using query parameters for authentication is :ref:`not safe <Authentication-QueryParams>`.
The auth params will appear on the URL and we recommend to NOT log your request, especially on production side.

VCR Plugin
``````````

The :doc:`VCR Plugin </plugins/vcr>` allows to record and/or replay HTTP requests. You can configure the mode you want,
how to find recorded responses and how to match requests with responses. The mandatory options are:

.. code-block:: yaml
// config.yml
httplug:
clients:
acme:
plugins:
- vcr:
mode: replay # record | replay | replay_or_record
fixtures_directory: '%kernel.project_dir%/fixtures/http' # mandatory for "filesystem" recorder
# recorder: filesystem
See :doc:`Full configuration </integrations/symfony-full-configuration>` for the full list of configuration options.

.. warning::

You have to explicitly require this plugin with composer (``composer require --dev php-http/vcr-plugin``) before
using it, as it isn't included by default.

Special HTTP Clients
````````````````````

Expand Down
9 changes: 9 additions & 0 deletions integrations/symfony-full-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,12 @@ This page shows an example of all configuration values provided by the bundle.
- query_defaults:
parameters:
locale: en
# Enable VCR plugin integration (Must be installed first).
- vcr:
mode: replay # record | replay | replay_or_record
fixtures_directory: '%kernel.project_dir%/fixtures/http' # mandatory for "filesystem" recorder
# recorder: filesystem ## Can be filesystem, in_memory or the id of your custom recorder
# naming_strategy: service_id.of.naming_strategy # or "default"
# naming_strategy_options: # options for the default naming strategy, see VCR plugin documentation
# hash_headers: []
# hash_body_methods: []

0 comments on commit b9bc9e0

Please sign in to comment.