You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting collect to true enables the profiler for all tests. However, if you need the profiler just in a few tests, you can keep it disabled globally and enable the profiler individually on each test by calling $client->enableProfiler().
However, it's not enough to call $client->enableProfiler() once per test. You must call it before each request (which also means, before each submit() form). Otherwise, you can't get the profiler. You can see that in the code of doRequest() in Client.php:
if ($this->profiler) {
$this->profiler = false; // <-- here, the value is reset$this->kernel->boot();
$this->kernel->getContainer()->get('profiler')->enable();
}
The text was updated successfully, but these errors were encountered:
…iereguiluz)
This PR was merged into the 2.8 branch.
Discussion
----------
Minor tweak about enalbing the profiler in the tests
This fixes#9583 and hopefully it's easier to understand now how it works.
Commits
-------
0c53710 Minor tweak about enalbing the profiler in the tests
Uh oh!
There was an error while loading. Please reload this page.
In this page (https://symfony.com/doc/current/testing/profiling.html) you can read:
However, it's not enough to call
$client->enableProfiler()
once per test. You must call it before each request (which also means, before eachsubmit()
form). Otherwise, you can't get the profiler. You can see that in the code ofdoRequest()
inClient.php
:The text was updated successfully, but these errors were encountered: