Permalink
Browse files

minor #3990 Move the section about collect: false to the cookbook ent…

…ry (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 #2952.

Cheers!

Commits
-------

d64fc55 Move the section about collect: false to the cookbook entry
  • Loading branch information...
weaverryan committed Jul 11, 2014
2 parents 2ae8281 + d64fc55 commit 90773b03425388542d1b0face5368eb4c47ce3b8
Showing with 49 additions and 46 deletions.
  1. +0 −46 book/testing.rst
  2. +49 −0 cookbook/testing/profiling.rst
@@ -480,52 +480,6 @@ 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
<!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<!-- ... -->
<framework:config>
<framework:profiler enabled="true" collect="false" />
</framework:config>
</container>
.. 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
~~~~~~~~~~~
@@ -73,3 +73,52 @@ finish. It's easy to achieve if you embed the token in the error message::
Read the API for built-in :doc:`data collectors </cookbook/profiler/data_collector>`
to learn more about their interfaces.
Speeding up Tests by not Collecting Profiler Data
-------------------------------------------------
To avoid collecting data in each test you can set the ``collect`` parameter
to false:
.. configuration-block::
.. code-block:: yaml
# app/config/config_test.yml
# ...
framework:
profiler:
enabled: true
collect: false
.. code-block:: xml
<!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<!-- ... -->
<framework:config>
<framework:profiler enabled="true" collect="false" />
</framework:config>
</container>
.. code-block:: php
// app/config/config.php
// ...
$container->loadFromExtension('framework', array(
'profiler' => array(
'enabled' => true,
'collect' => false,
),
));
In this way only tests that call ``$client->enableProfiler()`` will collect data.

0 comments on commit 90773b0

Please sign in to comment.