Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e6f4b2

Browse filesBrowse files
committed
[FrameworkBundle] Fix calling Client::getProfile() before sending a request
1 parent 675d463 commit 9e6f4b2
Copy full SHA for 9e6f4b2

File tree

2 files changed

+4
-4
lines changed
Filter options

2 files changed

+4
-4
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Client.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Client.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getKernel()
6666
*/
6767
public function getProfile()
6868
{
69-
if (!$this->kernel->getContainer()->has('profiler')) {
69+
if (null === $this->response || !$this->kernel->getContainer()->has('profiler')) {
7070
return false;
7171
}
7272

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ProfilerTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public function testProfilerIsDisabled($insulate)
2828

2929
// enable the profiler for the next request
3030
$client->enableProfiler();
31-
$crawler = $client->request('GET', '/profiler');
32-
$profile = $client->getProfile();
33-
$this->assertInternalType('object', $profile);
31+
$this->assertFalse($client->getProfile());
32+
$client->request('GET', '/profiler');
33+
$this->assertInternalType('object', $client->getProfile());
3434

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.