diff --git a/book/testing.rst b/book/testing.rst index 5ec4ebaf683..65104368a11 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -473,6 +473,52 @@ To get the Profiler for the last request, do the following:: For specific details on using the profiler inside a test, see the :doc:`/cookbook/testing/profiling` cookbook entry. +To avoid collecting data in each test you can set the ``collect`` parameter +in the configuration: + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config_test.yml + + # ... + framework: + profiler: + enabled: true + collect: false + + .. code-block:: xml + + + + + + + + + + + + + .. code-block:: php + + // app/config/config.php + + // ... + $container->loadFromExtension('framework', array( + 'profiler' => array( + 'enabled' => true, + 'collect' => false, + ), + )); + +In this way only tests that call ``enableProfiler()`` will collect data. + Redirecting ~~~~~~~~~~~