8000 minor #3990 Move the section about collect: false to the cookbook ent… · damienalexandre/symfony-docs@90773b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 90773b0

Browse files
committed
minor symfony#3990 Move the section about collect: false to the cookbook entry (weaverryan)
This PR was merged into the 2.3 branch. Discussion ---------- Move the section about collect: false to the cookbook entry | Q | A | ------------- | --- | Doc fix? | no | New docs? | no | Applies to | all (or 2.3+) | Fixed tickets | no This originates from symfony#2952. Cheers! Commits ------- d64fc55 Move the section about collect: false to the cookbook entry
2 parents 2ae8281 + d64fc55 commit 90773b0

File tree

2 files changed

+49
-46
lines changed

2 files changed

+49
-46
lines changed

book/testing.rst

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -480,52 +480,6 @@ 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-
529483
Redirecting
530484
~~~~~~~~~~~
531485

cookbook/testing/profiling.rst

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,52 @@ finish. It's easy to achieve if you embed the token in the error message::
7373

7474
Read the API for built-in :doc:`data collectors </cookbook/profiler/data_collector>`
7575
to learn more about their interfaces.
76+
77+
Speeding up Tests by not Collecting Profiler Data
78+
-------------------------------------------------
79+
80+
To avoid collecting data in each test you can set the ``collect`` parameter
81+
to false:
82+
83+
.. configuration-block::
84+
85+
.. code-block:: yaml
86+
87+
# app/config/config_test.yml
88+
89+
# ...
90+
framework:
91+
profiler:
92+
enabled: true
93+
collect: false
94+
95+
.. code-block:: xml
96+
97+
<!-- app/config/config.xml -->
98+
<?xml version="1.0" encoding="UTF-8" ?>
99+
<container xmlns="http://symfony.com/schema/dic/services"
100+
xmlns:framework="http://symfony.com/schema/dic/symfony"
101+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
102+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
103+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
104+
105+
<!-- ... -->
106+
107+
<framework:config>
108+
<framework:profiler enabled="true" collect="false" />
109+
</framework:config>
110+
</container>
111+
112+
.. code-block:: php
113+
114+
// app/config/config.php
115+
116+
// ...
117+
$container->loadFromExtension('framework', array(
118+
'profiler' => array(
119+
'enabled' => true,
120+
'collect' => false,
121+
),
122+
));
123+
124+
In this way only tests that call ``$client->enableProfiler()`` will collect data.

0 commit comments

Comments
 (0)
0