Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 329e254

Browse filesBrowse files
committed
Backporting #2952, which I committed to master instead of 2.3
1 parent d6787b7 commit 329e254
Copy full SHA for 329e254

File tree

Expand file treeCollapse file tree

1 file changed

+46
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+46
-0
lines changed

‎book/testing.rst

Copy file name to clipboardExpand all lines: book/testing.rst
+46Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,52 @@ To get the Profiler for the last request, do the following::
480480
For 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+
483529
Redirecting
484530
~~~~~~~~~~~
485531

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.