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 1 commit
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
26 changes: 26 additions & 0 deletions integrations/symfony-bundle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,32 @@ 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
recorder: filesystem # optional
fixtures_directory: '%kernel.project_dir%/fixtures/http' # mandatory for "filesystem" recorder
naming_strategy: service_id.of.naming_strategy # optional
naming_strategy_options: # optional
hash_headers: []
hash_body_methods: []

.. 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
recorder: filesystem # optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we list the other options here?

fixtures_directory: '%kernel.project_dir%/fixtures/http' # mandatory for "filesystem" recorder
naming_strategy: service_id.of.naming_strategy # optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would put the optional lines commented out, as by default it works fine.

naming_strategy_options: # optional
hash_headers: []
hash_body_methods: []