-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
BrowserKitStatus: Needs ReviewbughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.
Milestone
Description
In this page (https://symfony.com/doc/current/testing/profiling.html) you can read:
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();
}
Metadata
Metadata
Assignees
Labels
BrowserKitStatus: Needs ReviewbughasPRA Pull Request has already been submitted for this issue.A Pull Request has already been submitted for this issue.