Skip to content

Commit

Permalink
[FrameworkBundle] Fix calling Client::getProfile() before sending a r…
Browse files Browse the repository at this point in the history
…equest
  • Loading branch information
dunglas committed Jun 25, 2019
1 parent 675d463 commit 9e6f4b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Client.php
Expand Up @@ -66,7 +66,7 @@ public function getKernel()
*/
public function getProfile()
{
if (!$this->kernel->getContainer()->has('profiler')) {
if (null === $this->response || !$this->kernel->getContainer()->has('profiler')) {
return false;
}

Expand Down
Expand Up @@ -28,9 +28,9 @@ public function testProfilerIsDisabled($insulate)

// enable the profiler for the next request
$client->enableProfiler();
$crawler = $client->request('GET', '/profiler');
$profile = $client->getProfile();
$this->assertInternalType('object', $profile);
$this->assertFalse($client->getProfile());
$client->request('GET', '/profiler');
$this->assertInternalType('object', $client->getProfile());

$client->request('GET', '/profiler');
$this->assertFalse($client->getProfile());
Expand Down

0 comments on commit 9e6f4b2

Please sign in to comment.