File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,52 @@ To get the Profiler for the last request, do the following::
480480For specific details on using the profiler inside a test, see the
481481:doc: `/cookbook/testing/profiling ` cookbook entry.
482482
483+ To avoid collecting data in each test you can set the ``collect `` parameter
484+ in the configuration:
485+
486+ .. configuration-block ::
487+
488+ .. code-block :: yaml
489+
490+ # app/config/config_test.yml
491+
492+ # ...
493+ framework :
494+ profiler :
495+ enabled : true
496+ collect : false
497+
498+ .. code-block :: xml
499+
500+ <!-- app/config/config.xml -->
501+ <?xml version =" 1.0" encoding =" UTF-8" ?>
502+ <container xmlns =" http://symfony.com/schema/dic/services"
503+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
504+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
505+ xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
506+ http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
507+
508+ <!-- ... -->
509+
510+ <framework : config >
511+ <framework : profiler enabled =" true" collect =" false" />
512+ </framework : config >
513+ </container >
514+
515+ .. code-block :: php
516+
517+ // app/config/config.php
518+
519+ // ...
520+ $container->loadFromExtension('framework', array(
521+ 'profiler' => array(
522+ 'enabled' => true,
523+ 'collect' => false,
524+ ),
525+ ));
526+
527+ In this way only tests that call ``enableProfiler() `` will collect data.
528+
483529Redirecting
484530~~~~~~~~~~~
485531
You can’t perform that action at this time.
0 commit comments