From 2f2dcf77a4e661dcbbae72f92874c5c9ca1ac950 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Mon, 20 May 2019 11:51:27 +0200 Subject: [PATCH 1/2] Add documentation for VCR Plugin --- integrations/symfony-bundle.rst | 26 +++++++++++++++++++++ integrations/symfony-full-configuration.rst | 9 +++++++ 2 files changed, 35 insertions(+) diff --git a/integrations/symfony-bundle.rst b/integrations/symfony-bundle.rst index a2b452e..f5df8c0 100644 --- a/integrations/symfony-bundle.rst +++ b/integrations/symfony-bundle.rst @@ -357,6 +357,32 @@ You can configure a client with authentication. Valid authentication types are Using query parameters for authentication is :ref:`not safe `. 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 ` 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 ```````````````````` diff --git a/integrations/symfony-full-configuration.rst b/integrations/symfony-full-configuration.rst index c3275f0..9ea8185 100644 --- a/integrations/symfony-full-configuration.rst +++ b/integrations/symfony-full-configuration.rst @@ -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 + 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: [] From 6c1f46042baf5e42baa06810c54923e5c3285060 Mon Sep 17 00:00:00 2001 From: Gary PEGEOT Date: Fri, 24 May 2019 23:02:58 +0200 Subject: [PATCH 2/2] Comment out optional params --- integrations/symfony-bundle.rst | 8 +++----- integrations/symfony-full-configuration.rst | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/integrations/symfony-bundle.rst b/integrations/symfony-bundle.rst index f5df8c0..2fda6a1 100644 --- a/integrations/symfony-bundle.rst +++ b/integrations/symfony-bundle.rst @@ -371,12 +371,10 @@ Allow you to enable the :doc:`VCR Plugin ` and configure the behav 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: [] + # recorder: filesystem + +You also specify parameters to configure your naming strategy, see :doc:`Full configuration ` for more details. .. warning:: diff --git a/integrations/symfony-full-configuration.rst b/integrations/symfony-full-configuration.rst index 9ea8185..8a5e40e 100644 --- a/integrations/symfony-full-configuration.rst +++ b/integrations/symfony-full-configuration.rst @@ -141,9 +141,9 @@ This page shows an example of all configuration values provided by the bundle. # Enable VCR plugin integration (Must be installed first). - 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: [] + # 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: []