Skip to content

Commit b9bc9e0

Browse files
committed
Merge branch 'GaryPEGEOT-feature/vcr-integration'
2 parents 4630d19 + f79e62a commit b9bc9e0

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

integrations/symfony-bundle.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,31 @@ You can configure a client with authentication. Valid authentication types are
357357
Using query parameters for authentication is :ref:`not safe <Authentication-QueryParams>`.
358358
The auth params will appear on the URL and we recommend to NOT log your request, especially on production side.
359359

360+
VCR Plugin
361+
``````````
362+
363+
The :doc:`VCR Plugin </plugins/vcr>` allows to record and/or replay HTTP requests. You can configure the mode you want,
364+
how to find recorded responses and how to match requests with responses. The mandatory options are:
365+
366+
.. code-block:: yaml
367+
368+
// config.yml
369+
httplug:
370+
clients:
371+
acme:
372+
plugins:
373+
- vcr:
374+
mode: replay # record | replay | replay_or_record
375+
fixtures_directory: '%kernel.project_dir%/fixtures/http' # mandatory for "filesystem" recorder
376+
# recorder: filesystem
377+
378+
See :doc:`Full configuration </integrations/symfony-full-configuration>` for the full list of configuration options.
379+
380+
.. warning::
381+
382+
You have to explicitly require this plugin with composer (``composer require --dev php-http/vcr-plugin``) before
383+
using it, as it isn't included by default.
384+
360385
Special HTTP Clients
361386
````````````````````
362387

integrations/symfony-full-configuration.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,12 @@ This page shows an example of all configuration values provided by the bundle.
138138
- query_defaults:
139139
parameters:
140140
locale: en
141+
# Enable VCR plugin integration (Must be installed first).
142+
- vcr:
143+
mode: replay # record | replay | replay_or_record
144+
fixtures_directory: '%kernel.project_dir%/fixtures/http' # mandatory for "filesystem" recorder
145+
# recorder: filesystem ## Can be filesystem, in_memory or the id of your custom recorder
146+
# naming_strategy: service_id.of.naming_strategy # or "default"
147+
# naming_strategy_options: # options for the default naming strategy, see VCR plugin documentation
148+
# hash_headers: []
149+
# hash_body_methods: []

0 commit comments

Comments
 (0)