Skip to content

Add documentation for VCR Plugin #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,30 @@ 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
``````````

Allow you to enable the :doc:`VCR Plugin </plugins/vcr>` and configure the behavior to use ( Replay, Record , Replay OR Record).

.. 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

You also specify parameters to configure your naming strategy, see :doc:`Full configuration </integrations/symfony-full-configuration>` for more details.

.. warning::

You have to explicitly require this plugin with composer (``composer require --dev php-http/vcr-plugin``) before
using it, as it isn't shipped 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
# naming_strategy_options:
# hash_headers: []
# hash_body_methods: []