[FrameworkBundle] Fix calling Client::getProfile() before sending a request
This commit is contained in:
parent
675d463cf5
commit
9e6f4b2122
@ -66,7 +66,7 @@ class Client extends BaseClient
|
||||
*/
|
||||
public function getProfile()
|
||||
{
|
||||
if (!$this->kernel->getContainer()->has('profiler')) {
|
||||
if (null === $this->response || !$this->kernel->getContainer()->has('profiler')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -28,9 +28,9 @@ class ProfilerTest extends WebTestCase
|
||||
|
||||
// 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());
|
||||
|
Reference in New Issue
Block a user